Search code examples
httpstateless

What does it mean for the web and the HTTP protocol to be stateless?


What does it mean for the web and the HTTP protocol to be stateless? Why are they stateless?


Solution

  • Stateless meaning:

    It does not keep track of configuration settings, transaction information or any other data for the next session. When a program "does not maintain state" (is stateless) or when the infrastructure of a system prevents a program from maintaining state, it cannot take information about the last session into the next, such as settings the user chose or conditions that arose during processing.

    HTTP:

    The HTTP protocol, which is the communications vehicle for Web transactions, is stateless. After a Web page is delivered to the user, the connection is closed. Counter measures, such as the use of cookies, have been developed to maintain the state of a user moving from page to page on a Web site.

    OR it can be simple web definition:

    A protocol is stateless if there is no relation between subsequent request-response pairs. The server can handle each request uniquely and does not have to keep a session state for the client.