by, 01-01-2012 at 03:50 PM (1820 Views)
One of the recommended approaches is HTTP session. A request is being identified by the session which is originated from similar browser during the conversation time period. Same session could be shared by all servlets. The JSESSIONID gets generated by server and is passed via cookies to the client, Built in SSL mechanism or URL rewriting (if cookies get off). For minimizing the objectís size stored in session, care shall be taken. To obtain the session in Java servlet proceed as following:
HttpSession session = request.getSession();
Sessions can be manually invalidated or timed out (configured in web.xml).
HTTP Session Management