Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSession invalidate not working?

 
Kenny Dilger
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
works fine by me.
post your full code.
 
Kenny Dilger
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic