This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Session Management Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session Management" Watch "Session Management" New topic

Session Management

S Chandra Mohan
Ranch Hand

Joined: Oct 19, 2000
Posts: 75
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
S Chandra Mohan

Have a wonderful day and wish u success<p>S Chandra Mohan<br />
Yoo-Jin Lee
Ranch Hand

Joined: Nov 01, 2000
Posts: 119
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.
HttpSession session = req.getSession(false);
if(session != null){
This will get any current session and if there is one then it will invalidate it.

Joined: Jan 05, 2001
Posts: 3
You should search the Tomcat-Users mailing list archive at'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.
I agree. Here's the link:
subject: Session Management
Similar Threads
how to check whether the session is valid or not?
How to set JSESSIONID's maxAge?
session validate is not working in internet explorer
Session Timeout Handling through java script
Combine two struts applications.