File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes problem in session managment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "problem in session managment" Watch "problem in session managment" New topic

problem in session managment

naval kumar
Ranch Hand

Joined: Jul 08, 2012
Posts: 37
Dear Sir,
I am getting problem in session management In my application Like if i logged in with two different users and At the time of Log out I invalidate the Session But My always first user is log out while i am doing log out the Second user.I am Using URL rewriting technique.

So sir Tell me 2 Things
1- In My Application I have Lot of Hyperlink At Right and Left Navigation of the Logged in User .So i have to Pass The Some parameter Through Each and Every Hyper Link So that Application Server recognize that the Request Come From The Same user??

2-I am Doing at the login time "request.getsession(true); session.setAttribute("username",username); And the Time of Log Out I am doing "session.removeAttribute("username");session.invalidate()"
So What i have to pass from the each and every Link to maintain the session By the User??? and how??
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
1. IF you are using URL rewriting, THEN all URLs must be rewritten in order to maintain identity.

2. session.invalidate() removes all linked references, no need to removeAttribute()

Are you trying to log in as two different users in the same browser instance?

naval kumar
Ranch Hand

Joined: Jul 08, 2012
Posts: 37
I am doing open By two Different Browser and i am Using WebSphere Application Server So please Tell me How Can I use URL Rewriting In My application and What should I have to pass From each and Every Link Or No need Such Type of Things The Application server will handle itself.
I agree. Here's the link:
subject: problem in session managment
jQuery in Action, 3rd edition