O'Reilly logo

Sams Teach Yourself EJB in 21 Days by Krishna Kothapalli, Ragae Ghaly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Tracking User Session by Servlets

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.

  • Hidden fields

  • HTTP cookies

  • HTTPSession object

  • URL rewriting

In the following section, we'll explore each technique.

Tracking User Session Using Hidden Fields

This mechanism tracks user session in a hidden field of an HTML page and passes the data between the client and the server. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required