session management??

how to manage sessions in JSP. I want to create a session as soon as user logs in and disable the session when he logs out. I also want to disable back button so that when he presses back button login page has to be opened.

When a user open the broser and done some work or some change and then close the browser then
it will be stored in cookie and also called the session time in which user access the browser.You can get session ID in jsp by using session.getId() and can set the session user by using session.setAttribute("Session",setsession),
When user does their work complete and want to close browser,It is called expire or destroy the session.You can find the session starting and ending using session.getCreationTime() and session.getLastAccessedTime() respactively.
JSP Stores and Retrieves Session Variables as thje following: