The code of session is not working properly. I copied a link and after logout when I tried to access that link than it was working without asking a login.
Here is the code of my login page on which I have created session:
String user_name=request.getParameter("user_name");
String pass=request.getParameter("pass");
session.setAttribute("user_name", user_name);
session.setAttribute("pass",pass);
Here is the code of that page on which I have transferred my session:
String user_name = (String)session.getAttribute("user_name");
Here is the code of logout page:
session.setAttribute("user_name", null);
session.invalidate();
response.sendRedirect("index.jsp");
response.addHeader("cache-control","no-cache");