This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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(); v1=(Vector)session.getValue("user"); login=(String)v1.elementAt(1); This is working fine. The problem i am facing is session doesn't invalidate through the following code: session.invalidate();
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.
Joined: Aug 22, 2001
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.
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? Bill