| I hit this issue too. The sessionTimeout doesn't work after I upgrade my jenkins from 2.19.3 to 2.121.2. After some investigation I found that winstone is upgrade from 3.1 to 4.2. It seems before 4.2 https://github.com/jenkinsci/winstone/blob/winstone-4.1/src/java/winstone/HostConfiguration.java It only uses sessionTimeout.
| @Override |
| |
public void postConfigure() throws Exception {| | |super.postConfigure();| | | | | |// if specified, override the value in web.xml| | |int sessionTimeout = Option.SESSION_TIMEOUT.get(args);| | |if (sessionTimeout>0)| | |getSessionHandler().setMaxInactiveInterval(sessionTimeout * 60);| | |} |
but in 4.2 https://github.com/jenkinsci/winstone/blob/winstone-4.2/src/main/java/winstone/HostConfiguration.java It uses sessionTimeout and sessionEviction.
| @Override |
| |
public void postConfigure() throws Exception { |
| |
super.postConfigure(); |
| |
|
| |
// if specified, override the value in web.xml |
| |
int sessionTimeout = Option.SESSION_TIMEOUT.get(args); |
| |
if (sessionTimeout>0) {| | |getSessionHandler().setMaxInactiveInterval(sessionTimeout * 60);| | |} |
| |
int sessionEviction = Option.SESSION_EVICTION.get(args); |
| |
getSessionHandler().getSessionCache().setEvictionPolicy( sessionEviction ); |
| |
} |
According to https://github.com/jenkinsci/winstone, the session will be evicted after 30 minutes if we don't set sessionEviction. --sessionEviction = Set the session eviction timeout for idle sessions. Default value is 30min. {{}} After I add --sessionEviction, it works now. |