Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to logout from a session??

843841Apr 25 2007 — edited May 9 2007
I tried using session.invalidate() function and session.removeValue() as well,but the problem is when i click on logout button and then try to access the restricted pages some of the pages prompt for login whereas others do not...Also next time when i login again and then logout,then session doesn't expire at all and all restricted pages are accessible...I am able to figure out why this is happening...Below are the few lines of code which i am using..I have made a logout servlet which is requested evrytime the user clicks on the logout button...



session.invalidate()
RequestDispatcher dispatcher=getServletContext().getRequestDispatcher("/html/frontpage.html");
dispatcher.forward(request,response);




Please help as i am really stuck ..Thanx
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 6 2007
Added on Apr 25 2007
3 comments
94 views