HTTP is a stateless protocol, and a Web application, such as a shopping cart, needs a mechanism of tracking user session over multiple HTML pages. A session is defined as a series of related browser requests that come from the same client during a certain period of time. Servlets provide the following mechanisms of tracking sessions. Notice that in all these techniques, some form of token is passed between the client and the server.
In the following section, we'll explore each technique.
This mechanism tracks user session in a hidden field of an HTML page and passes the data between the client and the server. The ...