Re: the meaning of stateless
Mike Schinkel <[email protected]>
| Newsgroups | gmane.comp.web.services.rest |
|---|---|
| Message-ID | <[email protected]> |
On Apr 22, 2013, at 6:37 PM, Will Hartung <[email protected]> wrote: > See if reading this helps at all, as it talks not so much to state > directly, but to sessions (which is what most folks are struggling > with when it comes to state in REST). > > Feel free to hit back with questions. > > http://stackoverflow.com/questions/1296421/rest-complex-applications/1297275#1297275 Thanks. It took several readings but I think I've got some better idea of issues with sessions but not with understanding state. What I derived from your SO post is that the issue with session is that its use can change the meaning of resource identifiers, i.e. if a cookie has "user ID" and the URL is "/cart/new" then the URLs identify changes depending on the user but it would not change with "/carts/{user_ID}/new?" So it would appear that the issue with session is actually an issue with HTTP headers implicitly contributing to the identity of a resource? If yes I think I can get my head around that but will need think about it when I encounter more use-cases to see if I can always apply it. However I'm still struggling with the concept of "state," and "application" state being different from some other kind of "bad" state for which I can't seem to wrap my head around. Now I do understand how the HTTPS state is different; it's state is at a different layer of architecture and those of us programming at the HTTP level can just assume it. But what is an example of "bad" state at the application level? I know that "sessions" have been called "bad" state, but are there other examples of "bad" state? And why are sessions bad? Is it merely because of the identity problem mentioned above, or is it the fact that sessions disappear after a timeout and they would be okay if we created them explicitly and killed them explicitly? Or is it something else? Again, thanks for helping me understand this. If I can finally grok it then it will be much easier to explain it to people who come to me asking for help. -Mike