I am facing a problem on sessions using Servlets and JSP when user login/logout in my application displaying last accessed usernames. When the user logged succussfully in application I am putting user information into session like
HttpSession ssession=request.getSession(false);
session.setattribute(username,"username");
When user clicks on loggout in application. I wrote code
HttpSession ssession=request.getSession(false);
if(session!=null){
session.invalidate();
}
response.setHeader("Pragma", "cache");
response.setHeader("Cache-Control", "private, must-revalidate");
I am checked the session is avaliable or not when user logout. The session is invalidate. But relogin the same browser with different user. I got lastaccess session user. I have already set the respone.setheader for login page and loaded page. I got same problem. This issue occurs only in client side (Production server). We are using Sun One application server 7.1.