This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes problem with logging out Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "problem with logging out" Watch "problem with logging out" New topic
Author

problem with logging out

Chintan Shah
Greenhorn

Joined: Jun 29, 2005
Posts: 27
Hi guys,
I have used session.invalidate() method for logout procedure...but once i log out..and press back button..instead of issuing a warning..it just gets logged in automatically.
anyone , any ideas, greatly appreciated.
chintan
Scott Dunbar
Ranch Hand

Joined: Sep 23, 2004
Posts: 245
What app server are you using? I've seen this behavior in older Tomcat versions but not recently.


<a href="http://forums.hotjoe.com/forums/list.page" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
Chintan Shah
Greenhorn

Joined: Jun 29, 2005
Posts: 27
I am using tomcat 3.3
Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Hey Chintahn , Its time for you to upgrade. I've been using Tomcat 5.0.16 which too is not the latest one. But you should try upgrading from 3.3. As older containers might not handle session tracking correctly..

For example , I had an small application which took username from an html page and there was a logout page, Once the user clicks logout and clicks back , And again tries to logout, He gets a value Thankyou for loggingout "NULL".. This time it invalidated the name of the user in session. But for this you also need to use session.removeAttribute("NAME OF YOUR SESSION VARIABLE");

Try this and let me know if it works fine..


Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....
Chintan Shah
Greenhorn

Joined: Jun 29, 2005
Posts: 27
Hey..thx
i would try out and let u know.
chintan
Chintan Shah
Greenhorn

Joined: Jun 29, 2005
Posts: 27
Its not working.
do you have any other idea.
chintan
Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Hi Chintan ,

First of all you need to post the code so that we can check and provide you with a possible solution. Also One other thing you can do is to expire the page once it is visited.. This is how you can do it..

<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>

Also the error which you are getting please post that too..
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem with logging out