Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to prevent session from expiring  RSS feed

 
Preeti Arora
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is there any way to prevent session from expiring programmatically?

Thanks.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the HttpSession.setMaxInactiveInterval method with a negative argument. That will prevent the session from ever expiring.
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alternatively, you can set

in your web.xml, but it's for all your sessions.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!