简体   繁体   English

Spring Boot应用程序在Apache之后的会话超时

[英]Session timeout in Spring Boot app behind Apache

My app uses Spring Boot and I want the user sessions timeout to be 12h. 我的应用程序使用Spring Boot,并且我希望用户会话超时为12h。 I put the server.session.timeout=43200 in my application.properties but the session is still expiring long before the 12 hours. 我将server.session.timeout = 43200放在了application.properties中,但是会话仍然在12小时之前过期。

The app runs in a Tomcat 7 instance behind an Apache server. 该应用程序在Apache服务器后面的Tomcat 7实例中运行。 Do I need to do any extra configuration in the container or server? 我是否需要在容器或服务器中进行任何其他配置?

Those properties ( server.* ) only work if SpringBoot is controlling Tomcat (ie SpringBoot with an embedded Tomcat deployed as an executable JAR), rather than when deploying it as a WAR into an existing Tomcat instance. 这些属性( server.* )仅在SpringBoot控制Tomcat(即将嵌入式Tomcat部署为可执行JAR的SpringBoot)控制时才起作用,而不是在将其作为WAR部署到现有Tomcat实例中时起作用。

So you'll need to configure the session timeout in one of the 'old' ways: eg 因此,您需要以“旧”方式之一配置会话超时:例如

Through Tomcat: Default session timeout for Apache Tomcat applications 通过Tomcat: Apache Tomcat应用程序的默认会话超时

Through Spring Security: Setting session timeout period with Spring Security 3.0 通过Spring Security: 使用Spring Security 3.0设置会话超时期限

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM