aspose file tools*
The moose likes Tomcat and the fly likes session timeout - how does it work? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "session timeout - how does it work?" Watch "session timeout - how does it work?" New topic
Author

session timeout - how does it work?

Raj Puri
Ranch Hand

Joined: Apr 24, 2003
Posts: 189
I set session time out to 30 minutes in web.xml file using:

session-config>30</session-config>

And I have a code like this in submit button:
<% if (!session.isNew()) { %>
alert("Session timeout, please close browser and restart session");
return false;
<% } %>

Seems no matter what the browser thinks it is an old session going on. I am
doing JSP page and want to set timeout in web.xml and have that message show up if noactivity for 30 minute. I have tried closing, restarting browser/Tomcat etc.

How can i do this?
Tim Baker
Ranch Hand

Joined: Oct 04, 2003
Posts: 541
your logic seems odd, surely it should be

if session is new show message "session expired"


Kim Jong II (North Korea's Dear Leader) said:Nuclear weapons don't kill people, people kill people.
Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
Should be..

<% if (session.isNew()) { %>
alert("Session timeout, please close browser and restart session");
return false;
<% } %>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: session timeout - how does it work?