• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

session-timeout & setMaxInactiveInterval()

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was wodering whats the difference between <session-timeout> in web.xml and the function call
session.setMaxInactiveInterval() function call apart from their argument type difference( minutes and seconds).
From the name, session.setMaxInactiveInterval(300) will close the session for after an inactive period of 5 minutes.
Thats clear.
What about <session-timeout> ?? Does the number we specify in <session-timeout> also relate to inactive period? or is it the whole session period (irrespective of active/inactive)
Rex
[ April 17, 2002: Message edited by: Rex Rock ]
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this sets the session-timeout for the entire app to 10 minutes
<session-config>
<session-timeout>10</session-timeout>
</session-config>
you can check this setting by calling session.getMaxInactiveInterval() and you can change it dynamically by calling session.setMaxInactiveInterval(int seconds)
so basically -- they do the same thing -- one at run-time, one at deploy-time
-- You can find more info about this in the Servlet 2.3 specification SRV.7.5
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We recently debated this topic in the SCWCD forum. Checkout the difference and the recommendations.
Part of my preparation for the cert.....
regds.
- madhav
reply
    Bookmark Topic Watch Topic
  • New Topic