Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes How to use different session timeouts for different levels of users Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to use different session timeouts for different levels of users" Watch "How to use different session timeouts for different levels of users" New topic
Author

How to use different session timeouts for different levels of users

Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
Hi All,

How can I increase the session time out for only admins?

Also I have seen "Keep me logged in forever" in some applications.
How can I do that.

Thanks
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
In your web.xml, you can use this piece to declare the default session timeout (in minutes)



a value of 0 causes the session to never expire.

If you want to override this setting, you can programmatically do that on the HttpSession object.



Note that the value you pass setMaxInactiveInterval is in seconds. And a value of 0 will cause the session to immediately expire.
If you want the session to never expire, use -1.

Also, this thread is about the Servlet Spec, hence it belongs to the Servlet forum.


JDBCSupport - An easy to use, light-weight JDBC framework -
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use different session timeouts for different levels of users
 
Similar Threads
session tracking
x JSP's use one EJB ?????
Passing the session variable from one HTML to JSP through Servlets?
handling the Session
x JSP's use one EJB ?????