• Post Reply Bookmark Topic Watch Topic
  • New Topic

tomcat session timeout  RSS feed

 
Sharang Thorat
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
in JSP pages i am storing some values in session variables.
alos beans are of session scope.I am using tomcat as servelt engine. Is there any way to control session timeout?
How can i increase the timeout beyond 30 min default for tomcat.
regards
sharang
 
Bosun Bello
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a method setMaxInactiveInterval. It sets the amount of time a session should go without access before being automatically invalidated.

Bosun
 
Raghavendra Holla
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change web.xml in <TOMCAT_HOME>/conf directory's <session-timeout> tag. By default it is 30. But it will be applicable to all session, i.e. all serverlet/JSP running under that tomcat server.
regards
holl@
 
gaurav chaudhary
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bosun Bello, I want to enquire about one thing that do we have to call thie method (setMaxInactiveInterval) every time we request the session or just once when we create the session.
thanks
gaurav
 
Peter Straw
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- I think it's just each time u create the session.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!