This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

2 approaches to set session timeout??

 
Sajee Joseph
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I have deployed my servlets in JBOSS server.
By default it takes 30 mins as session timeout.
There are 2 approaches for this:

1. The HttpSession object has setMaxInactiveInterval() method which can be used to control the session.
2. Also i have heard that i can configure the web.xml for this session timeout value.
Am i right about this?
Among these 2 approaches which is a better one?
Regards,
Sajee Joseph
 
john smith
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keeping config stuff in web.xml is always preferable. You don't have to rewrite code to reconfigure your app, and you know there is only one source for config values.
[ March 10, 2004: Message edited by: john smith ]
 
Brian Showalter
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On our in-house intranet, I like to set a short (10 minutes) default session timeout in the web.xml, and when users log in the timeout is increased to one hour. Since most users are primarily interested in viewing openly accessible information which does not require a login, this helps to keep sessions from consuming resources unnecessarily.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic