Some said that HTTP has no concept of session because HTTP is stateless. Is it true? Why is that?
Thanks.
Some said that HTTP has no concept of session because HTTP is stateless. Is it true? Why is that?
Thanks.
This is a design decision made during HTTP design. The motivation seems to be scalability and response time. If a web-server were to serve 100million concurrent users and each of them were to store 100bytes of state information, that would be 10GB of information that needs to be consulted real (read RAM ) time and processed before a response is given. This was a major challenge when the protocol was designed. In addition to this issue that would surface when the HTTP is actively serving users, keeping state information would create large demand in setting up a new request (assign space, bind to the session etc.) and error handling (such as user closing his browser in the middle) and so on. As an example, TCP (over which HTTP runs) has a session concept. While designing solutions to accelerate TCP, it was found that setting up, tearing down and error handling was the hardest part to accelerate where as it was easier to accelerate the actual data transfer.
That said, cookies store information on the client side and create an impression of a session.