我有一个正在安装在Google App Engine中的Spring Boot应用程序。 我需要根据条件设置会话超时。
我尝试在spring安全配置中以
的形式附加一个successHandler protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.ALWAYS)
.and()
.successHandler(successHandler())
}
这是成功处理程序
private AuthenticationSuccessHandler successHandler() {
return (httpServletRequest, httpServletResponse, authentication) -> {
httpServletRequest.getSession().setMaxInactiveInterval(10);
};
}
我发现Google App Engine使用码头服务器(实际上是码头9),并且 它经常将创建的会话存储在Memcache和数据存储区中。 应用引擎如何不遵守通过调用
设置的会话超时的一些方法httpServletRequest.getSession().setMaxInactiveInterval(10);