Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • Thanks cmc, all good points and great food for thought. I've ended up taking a token/HMAC approach similar to the one you discussed above, rather like the S3 REST API authentication mechanism. Commented Mar 26, 2012 at 18:00
  • If you cache the token on the server, then isn't it essentially the same as the good old session id? Session id is short-lived and it is also attached to fast cache storage (if you implement it) to avoid hitting your DB on every request. True RESTful & stateless design should not have sessions, but if you are using a token as an ID and then still hitting the DB, then wouldn't it better just use session ID instead? Alternatively, you can go for JSON web tokens that contain encrypted or signed information for entire session data for true stateless design. Commented Sep 8, 2017 at 7:16