If REST applications are supposed to be stateless, how do you manage sessions?

前端 未结 16 1198
既然无缘
既然无缘 2020-11-22 10:23

I\'m in need of some clarification. I\'ve been reading about REST, and building RESTful applications. According to wikipedia, REST itself is defined to be Representation

16条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 10:31

    Stateless here means that state or meta data of request is not maintained on server side. By maintaining each request or user's state on server, it would lead to performance bottlenecks. Server is just requested with required attributes to perform any specific operations.

    Coming to managing sessions, or giving customize experience to users, it requires to maintain some meta data or state of user likely user's preferences, past request history. This can be done by maintaining cookies, hidden attributes or into session object.

    This can maintain or keep track of user's state in the application.

    Hope this helps!

提交回复
热议问题