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

Session Invalidation

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
What if i have
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
in my deployment descriptor, and along with this, I perform setMaxInactiveInterval(2400) for my session object.
The first one denotes 30 minutes and the second one is 40 minutes. Which one will be followed; that is, how long will my session expire? Will it be 30 or 40 minutes?
What if for example I interchanged the figures -- i have 40 minutes in deloyment descriptor and 30 minutes for setMaxInactiveInterval()?
Thank you very much.
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The discussion of Session timeout from Servlet Specs
"The default timeout period for sessions is defined by the servlet container and can be obtained via the getMaxInactiveInterval method of the HttpSession interface. This timeout can be changed by the Developer using the setMaxInactiveInterval method of the HttpSession interface."
The timeout defined in your DD is used until you redefine it with setMaxInactiveInterval. So, if you use setMaxInactiveInterval that will be the timeout for that servlet regardles of the value in the DD.
------------------
I Hope This Helps
Carl Trusiak, SCJP2
 
marlon tan
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much, Sir!
 
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic