Session Tracking in Servlets

Session Tracking is a way to maintain state (data) of an user. It is also known as session management in servlet.

A web container can utilize a few systems to relate a session with a client, all of which include passing an identifier between the customer and the server. The identifier can be kept up on the customer as a treat, or the web segment can incorporate the identifier in each URL that is come back to the customer. HTTP is stateless that implies every request is considered as the new demand. It is appeared in the figure given beneath:

HTTP is stateless that means each request is considered as the new request. It is shown in the figure given below:

session tracking

Why use Session Tracking?

To recognize the user It is used to recognize the particular user.

There are four different techniques used by Servlet application for session management. They are as follows:

Session Tracking Techniques

There are four techniques used in Session tracking:

  1. Cookies
  2. Hidden Form Field
  3. URL Rewriting
  4. HttpSession