当前不存在httpsession,httpsession中没有可用的securitycontext:null将创建一个新的

yebdmbv4  于 2021-09-29  发布在  Java
关注(0)|答案(1)|浏览(293)

应用程序在本地计算机上工作正常,但在服务器上面临自动会话超时。

DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository - No HttpSession currently exists
02:45:03.270 [http-nio-8080-exec-5] DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository - No SecurityContext was available from the HttpSession: null. A new one will be created.
02:45:03.270 [http-nio-8080-exec-5] DEBUG org.springframework.security.web.FilterChainProxy - /web/filerequeststransactionses/?page=3&size=10 at position 2 of 10 in additional filter chain; firing Filter: 'LogoutFilter'
02:45:03.270 [http-nio-8080-exec-5] DEBUG org.springframework.security.web.FilterChainProxy - /web/filerequeststransactionses/?page=3&size=10 at position 3 of 10 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter'
02:45:03.270 [http-nio-8080-exec-5] DEBUG org.springframework.security.web.FilterChainProxy - /web/filerequeststransactionses/?page=3&size=10 at position 4 of 10 in additional filter chain; firing Filter: 'BasicAuthenticationFilter'
02:45:03.270 [http-nio-8080-exec-5] DEBUG org.springframework.security.web.FilterChainProxy - /web/filerequeststransactionses/?page=3&size=10 at position 5 of 10 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
02:45:03.271 [http-nio-8080-exec-5] DEBUG org.springframework.security.web.FilterChainProxy - /web/filerequeststransactionses/?page=3&size=10 at position 6 of 10 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
02:45:03.271 [http-nio-8080-exec-5] DEBUG org.springframework.security.web.FilterChainProxy - /web/filerequeststransactionses/?page=3&size=10 at position 7 of 10 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
02:45:03.271 [http-nio-8080-exec-5] DEBUG org.springframework.security.web.authentication.AnonymousAuthenticationFilter - Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@6faa3d44: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffff4c9c: RemoteIpAddress: 10.92.0.136; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'
02:45:03.271 [http-nio-8080-exec-5] DEBUG org.springframework.security.web.FilterChainProxy - /web/filerequeststransactionses/?page=3&size=10 at position 8 of 10 in additional filter chain; firing Filter: 'SessionManagementFilter'

在pom.xml中使用这些属性

fzwojiic

fzwojiic1#

您可能将服务器匿名会话(前往站点)与服务器的实际登录会话混淆。无论哪种方式,您都可以创建一个http会话,正如错误所说,它在第一次访问时无论如何都会创建一个http会话。会话对象是如何保存的。可能是域中的一个小问题,即您如何关联在您的测试本地主机中保持会话。或者可能是服务器依赖于cookie和其中的域路径(可能是指在cookie中更改localhost的时间,例如配置xml)。

相关问题