You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Bragg, Casey" <Ca...@allegiancetelecom.com> on 2000/03/21 17:00:42 UTC

Session invalidation/ creation

I've got a jsp page with a logout button.  Pressing the button results in
the following code fragments being run.  Though the strategy worked with
JServ, its not working with Tomcat 3.0.  Any ideas why?

HttpSession session = request.getSession(false); 
   // Consider that the current session has already 
   // been established by an earlier request.getSession(true)

session.invalidate();

session = request.getSession(true);
   // For some reason (in Tomcat 3.0) session now points 
   // to the same session which is already invalidated.  
   // In other words, this doesn't return a new session.
   // Subsequent attempts to use session result in 
   // exceptions such as...
   // javax.servlet.ServletException: getAttribute: Session already
invalidated

Thanks...

...Casey