Session is a variable is used to store current user information.it will expired when the browser is closed OR the default session expired time is 20 minutes.
Session is a variable is used to store current user information.it will expired when the browser is closed OR the default session expired time is 30 minutes.
By using session object we can maintaing the state of the data which is helpful for maintaining the session(i.e to keep track of the information of the same client during the consecutive visits of the application)we can obtain the session object by using the following code:HttpSession sn request.getSession();we can store the attributes in session object by usingsession.setAttribute(String sn Object value);we can obtain the attributes by usingsession.getAttribute(String name);