I have a servlet that destroys the current session with invalidate. To get the session I am using getSession(false). The thing is, I am calling this servlet many times in a row and it always seems to destroy a new session. I am displaying the session ID for debugging.
How is this session created each time if I am not creating it. What I am looking for is destroying the session and then not having a new one the next time I call to destroy it.
Anybody knows why I seem to always get a new session? I'm totally confused now.
Check out your JSP pages. Many JSP pages have tags that automatically create a session when they are used. If you are forwarding to a JSP page, it may have an innocuous tag that is creating a new session right after your Servlet kills it. [ August 27, 2006: Message edited by: Bear Bibeault ]
Joined: Dec 01, 2004
Thanks. I will investigate that. I am forwarding to a JSP, but I have only this on it: