The setup is simple and there are three ways to do this:
(1) Add: Session.setmaxinactiveinterval (600) on the main page or on the public page, and the parameter 600 is in seconds, that is, the session will expire after No 10-minute activity.
It is important to note that the time set by this session is calculated on the server, not the client. So if you are debugging a program, you should modify the server-side time to test instead of the client.
(2) It is also a more general way to set the session expiration time, which is set in the Project Web. xml
<!--set session invalidation, units---
<session-config>
<session-timeout>1</session-timeout>
</session-config>
Set to 0,-1 means never time out
(3) Directly in the application server settings, if it is tomcat, you can find the <session-config> element in the Tomcat directory Conf/web.xml, tomcat default setting is 30 minutes, as long as you modify this value.
Session-config in Tomcat's/conf/web.xml, the default value is: 30 minutes
<session-config>
<session-timeout>30</session-timeout>
</session-config>
It should be noted that if the above three places are set, there is a priority problem, from high to Low: (1) > (2) > (3)
Session Timeout setting