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

How to use different session timeouts for different levels of users

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic