wood burning stoves 2.0*
The moose likes Servlets and the fly likes HttpSession invalidate not working? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HttpSession invalidate not working?" Watch "HttpSession invalidate not working?" New topic
Author

HttpSession invalidate not working?

Kenny Dilger
Greenhorn

Joined: Jan 14, 2002
Posts: 11
For some reason when I invalidate a Session it does not seem to be working. If I have the following code.
session.invalidate();
session = request.getSession(true);
System.err.println("invalidated:" + session.getId());
forwardToPage("/mailapp/Login.jsp", request, response);
The Session ID printed out is the same session ID that was printed out when the session was first created. What could be going on. Could it be a problem at where I am declaring my HttpSession variable? I have another thread asking about HttpSession scope.
Thanks,
Kenny
Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
works fine by me.
post your full code.


Asher Tarnopolski
SCJP,SCWCD
Kenny Dilger
Greenhorn

Joined: Jan 14, 2002
Posts: 11
I fixed it. I think it had to do with the scoping of my HttpSession declaration. I was declaring it as an instance variable. I now have it local and pass it around to the necessary methods and all works fine.
Thanks!
Kenny
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HttpSession invalidate not working?
 
Similar Threads
Invalidating HttpSession on JBoss 4.2.2 vs. 5.0.0Beta
How to get a HttpSession from a Session ID ?
HttpSessionListener if browser is closed
Session Doubt
Invalidating HttpSession on JBoss 4.2.2 vs. 5.0.0Beta