• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

session timeout - how does it work?

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 542
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
your logic seems odd, surely it should be

if session is new show message "session expired"
 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Should be..

<% if (session.isNew()) { %>
alert("Session timeout, please close browser and restart session");
return false;
<% } %>
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic