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.