This is the code that I have written in login page
HttpSession session = request.getSession(true);
session.setAttribute("name", user1);
String nme=(String) session.getAttribute("name");
And, This is the code for logout.jsp
<% request.getSession().invalidate();
OR
if(session!=null){
session=null;
}
OR
request.getSession().setAttribute("name", null); //it just assigns null to attribute
response.sendRedirect("login.jsp");
%>
session is creating, But after logout button is working.... I want that back button should not work.