rest - Sessions in a RESTful API -
this question has answer here:
- do sessions violate restfulness? 6 answers
i reading on rest, , 1 of specifications of rest should stateless, , every request should contain necessary state in url or body of request. contrasts practice of using sessions, helpful maintaining information whether user logged in or not. so, if 1 wants design restful api, should sessions avoided?
well, yes, @ least on server side. that' in fact, kind of point of rest: representational state transfer. making sure needed state information contained in state being transfered on http, , eliminating server-side session state, makes possible build scaleable, expandable ends.
back in old days had worry session state, maintaining sessions, keepalive connections, state-sensitive load-balancing, , on , on. rest, that's eliminated.
so now, here's pop quiz: how maintain state things login status without server side state? he's hint: html not state client manages you.
Comments
Post a Comment