Online Software Educational Training - IT Tutorials - Online Education Training for Computer Software


Home

JAVA SERVLET

Session Tracking

Session Tracking using HttpSession object

Session tracking is a mechanism that servlets use to maintain state about a series of requests from the same user (that is, requests originating from the same browser) across some period of time.

Sessions are shared among the servlets accessed by a client. This is convenient for applications made up of multiple servlets.

Because HTTP is a request-response based protocol, a session is considered to be new until a client “joins” it. A client joins a session when session tracking information has been successfully returned to the server indicating that a session has been established. Until the client joins a session, it cannot be assumed that the next request from the client will be recognized as part of the session. 

The session is considered to be “new” if either of the following is true:

  • The client does not yet know about the session
  • The client chooses not to join a session. This implies that the servlet container has no mechanism by which to associate a request with a previous request.

 


Previous

Next