1. Spring Boot:
server.session.cookie.comment = # comment Session cookie. Server . Session.cookie.domain = # session cookie domain. Server . session.cookie.http-only =# "HttpOnly" Flag is a session cookie. Server . session.cookie.max-age =. Session.cookie.name = # session cookie name. Server . Session.cookie. path = # The path of the session cookie. Server . session.cookie.secure =. session.persistent = False # persists session data between reboots. Server . Session.store-dir =. session.timeout = # Session timeout (seconds). Server . Session.tracking-modes =# Session tracking mode (one or more of the following: "Cookie", "url", "SSL").
2. The Web container, such as Tomcat, can set the timeout time to 30 minutes
3. Session-config configuration in Web. xml
The session-timeout element is used to specify the default session time-out interval, in minutes. The element value must be an integer. If the value of the session-timeout element is zero or negative, it means that the session will never time out. For example, set the session expiration time to 30 minutes:
< Session-config > < Session-timeout ></session-timeout></session-config >
4, in the program call session Setmaxinactiveinterval method settings
Session.setmaxinactiveinterval (30 * 60);
Setmaxinactiveinterval sets the expiration time for the current session, not the entire web time, in seconds. If the value is set to zero or negative, the session will never time out. Often used to set the current session time.
Reference:
http://blog.csdn.net/zuyi532/article/details/7536287
Set session Expiration Time in Java (Spring Boot)