Browse - Programming Tips - Servlet: how can I set the timeout of my session variables?

Date: 2018feb5
Language: Java
Platform: Servlet
Keywords: variable

Q.  Servlet: how can I set the timeout of my session variables?

A.  In the war's web.xml:

<session-config> <session-timeout>5</session-timeout> </session-config>
The timeout is in minutes. So set it to 1440 for a day. -1 means never timeout.