Servlet Tutorial

Session Management

Whenever we make a request that request can be processed by group of Servlets and we get single response (in case of servlet chaining).

In general scenario we may make much number of requests to many numbers of Servlets to get many numbers of responses. By default all these 'n' number of requests and responses are independent to each other. Since, the protocol which we are using is http. http protocol is a stateless protocol. A stateless protocol is one which never maintains an identity of the client forever.

In order to make 'n' number of independent request and responses as a consecutive request and responses we must use the concept of session management or session tracking.

Session management is a process of maintaining an identity of the client for a period of time for multiple requests to get multiple responses across the network.

Session management techniques:

In order to maintain an identity of the client for a period of time, we have four types of session management techniques; they are Cookies, HttpSession, Hidden form field and URL rewritten.