聊聊springboot session timeout参数设置
发布网友
发布时间:2022-11-16 04:19
我来回答
共1个回答
热心网友
时间:2024-03-20 09:26
本文主要介绍下spring boot中对session timeout参数值的设置过程。
spring-boot-autoconfigure-1.5.8.RELEASE-sources.jar!/org/springframework/boot/autoconfigure/web/ServerProperties.java
spring-boot-1.5.8.RELEASE-sources.jar!/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java
可以从源码看到,如果设置小于60秒的话,则会默认取1分钟
tomcat-embed-core-8.5.23-sources.jar!/org/apache/catalina/core/StandardContext.java
tomcat-embed-core-8.5.23-sources.jar!/org/apache/catalina/session/StandardSession.java
这个是在这个方法中更新
tomcat-embed-core-8.5.23-sources.jar!/org/apache/coyote/http11/Http11Processor.java
tomcat-embed-core-8.5.23-sources.jar!/org/apache/catalina/connector/CoyoteAdapter.java
tomcat-embed-core-8.5.23-sources.jar!/org/apache/catalina/connector/Request.java
里头的方法会调用recycleSessionInfo
tomcat-embed-core-8.5.23-sources.jar!/org/apache/catalina/core/ApplicationDispatcher.java
tomcat-embed-core-8.5.23-sources.jar!/org/apache/catalina/core/ApplicationHttpRequest.java