Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Session Expiring Time?

 
Ranch Hand
Posts: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guyz,
I am trying to allow user to set his Session time.After that time Session must expires.I am writing the pseudocode here:
1: Get the user defined time in sessionTime
2: mySession.setMaxInactiveInterval(sessionTime)
3: if(mySession==null)
out.println("Session Expired")
esle
out.println("Session Active")
Explanation:-
Step 1 is done is a 1st Servlet
Step 2 is done in a 2nd Servlet
Step 3 is done in a 3rd Servlet

A/C to me the above logic is clear.But when I run Servlet, I give i/p 1.That is 1 seconds Session time, But Session is active after 1 second and expires beore 1 minute.Why not it expires right after 1 second?.
Bye,
Viki.
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems that I read somewhere that when the time limit is reached the server will have to opportunity to invalidate the session but may not do it right away.
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As mentioned above, I would not expect the container to invalidate the session exactly on x number of seconds.
Most likely the container checks for timed out sessions once every X minutes. I would consult the docs of the server you are using to see if you can adjust this, or at the very least see if you can determine the value.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic