Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes 2 approaches to set session timeout?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "2 approaches to set session timeout??" Watch "2 approaches to set session timeout??" New topic
Author

2 approaches to set session timeout??

Sajee Joseph
Ranch Hand

Joined: Jan 17, 2001
Posts: 200
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

Joined: Mar 04, 2004
Posts: 75
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

Joined: Sep 20, 2002
Posts: 3
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 2 approaches to set session timeout??
 
Similar Threads
Monitoring the Activity in an HTML Frame.
Servlets and session...Do I need to?
Value for session timeout
Tomcat Session Timeout
Session Timeout in iAS 6.0