Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Management

 
S Chandra Mohan
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,
Iam using sessions to keep track with user id and passwords.
But when i close the prevoious user and entry and open new user
, in the same browser, then content relating to previous user is getting displayed.
This is giving high problem to me.
Is there any solution that i can remove all the traces of previous session before going for a new session.
Thanks in advance
Regards
S Chandra Mohan
 
Yoo-Jin Lee
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I can't tell exactly what's wrong since you didn't post any code but it sounds like your not invalidating your session correctly.
Try:
HttpSession session = req.getSession(false);
if(session != null){
session.invalidate();
}
This will get any current session and if there is one then it will invalidate it.
cheers,
Yoo-Jin.
 
Diskmuncher
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should search the Tomcat-Users mailing list archive at http://jakarta.apache.org..I've seen this question before with several different potential solutions, including the one posted previously. Another method is to not use cookies, but instead use URL-rewriting...and the login page should neither check for nor use a JSessionID in the URL.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic