wood burning stoves 2.0
The moose likes Servlets and the fly likes Session doesn't  invalidate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session doesn Watch "Session doesn New topic

Session doesn't invalidate

amit kr

Joined: Aug 22, 2001
Posts: 4
I am using session object of JSP.
To maintain id of user throughout the application,i keep the user id in a Vector and then i put it in the session.
Vector v1=new Vector();
This is working fine.
The problem i am facing is session doesn't invalidate through the following code:

Amit kr
vivek sivakumar
Ranch Hand

Joined: Aug 09, 2001
Posts: 187
well its better if u could create another page (logout.jsp) and in there include this session.invalidate () to be more clear in ur jsp page have a button for logout and then when user cliks on it then he should be directed to this page which does this invalidation!!! thats the best way , else if u include this session.invalidate in ur normal working pages then whole of session will be invalidated beware !

SCJP, SCWD <br />A farmer learns more from a bad harvest than a good one.
amit kr

Joined: Aug 22, 2001
Posts: 4
Thanks Vivek,
Infact what ever you suggested i am doing the same.
But still i face this problem.
I need to know is there any other way to invalidate session.

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
I feel sure that session.invalidate() works - if you are having a problem, the cause lies elsewhere. Have you checked the contents of the session to make sure you have the right one before invalidating?
I agree. Here's the link: http://aspose.com/file-tools
subject: Session doesn't invalidate
jQuery in Action, 3rd edition