Thursday, June 19, 2008

Maintaing web session state without cookies

Maintaining Session State without Cookies


Some browsers do not recognize cookies, and users can choose to disable cookies in their browsers. The HTTP POST method provides an alternative to cookies to maintain session state. The HTTP POST method provides the same state information as would a cookie but has the advantage that it works even when cookies are not available. This method is not common in practice, but it is a good example to learn from. The HTTP POST method works similarly to an in-memory cookie; user information can be maintained only during the visit, and the session state information is gone when the user turns off the browser.


There are two kinds of cookies, as follows:

  • In-memory cookies: An in-memory cookie goes away when the user shuts the browser down.

  • Persistent cookies: A persistent cookie resides on the hard drive of the user and is retrieved when the user comes back to the Web page.


No comments: