File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
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: 12982
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:
subject: Session doesn't invalidate
It's not a secret anymore!