Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session-timeout & setMaxInactiveInterval()

 
Rex Rock
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • 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 ]
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • 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
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic