You can also bind objects to the session, which store them for use by other components.This section includes the following topics: returns the valid session object associated with the request, identified in the session cookie that is encapsulated in the request object.For example, the Java Web Server has the ability to revert to using URL rewriting when cookies fail, and it allows session objects to be written to the server's disk as memory fills up or when the server shuts down.(The items you place in the session need to implement the interface to take advantage of this option.) See your server's documentation for details pertaining to your server.Fortunately for us servlet developers, it's not always necessary for a servlet to manage its own sessions using the techniques we have just discussed.The Servlet API provides several methods and classes specifically designed to handle session tracking on behalf of servlets.At the end of that article I have given a preview about “5. An elite way to manage the session in servlets is to use API.
Binds the specified object into the session with the given name.
Calling the method with no arguments creates a session if one does not exist that is associated with the request.
Additionally, calling the method with a Boolean argument creates a session only if the argument is Returns a Boolean value indicating if the session is new.
If we login to the application again request.getsession(true) will ...
I have read a lot of posts about this, but none of the solutions have worked for me.