Session management and cookies in servlet


Session is a time interval devoted to an activity.

Session Tracking:

Session Tracking or session management is a way of maintaining the state of the user.

Need of Session Tracking:

As we discussed in earlier tutorials we are using HTTP for completing request response cycle. HTTP is a stateless protocol which means when a new request comes it can’t keep any record or state of previous request of the user. That’s why we need session tracking for maintaining the state of the user.

Way of Session Tracking in servlet:

  1. Cookie.
  2. Hidden form field.
  3. Url rewriting.
  4. HttpSession.

  Next Topic: Cookie in servlet with example. Previous Topic: Servlet Hello World Example using annotation with example.


Please follow and like us:
Content Protection by