Session object is medium to interact with client and server. Session is a connection between user and server, involving exchange of information between user’s computer and server. Server knows information about each other by these session object. Web server put information of user in session object and whenever it needs information gets it from these session objects. This session object stores information in key value pair, just like hash table.
Session object is set by:- session.setAttribute(attribute) method
session object is get by:- session.getAttribute(attribute) method
And atlast session is destroy by session.invalidate() method