-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Http Session recreated after invalidate #1255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The code in 2.1.1 is a bit different but it looks like it is still affected by this. |
Thanks for the report @lRawd. It's not clear to me which exact sequence of events is required to reproduce this? Any chance you could put together a minimal sample app that would help us understand the problem better? |
I think its as simple as calling: request.getSession(true).invalidate();
//...
request.getSession(false).getId(); I will double check and put a sample together. |
Thanks for following up - I've tried something along those lines but |
In 2.1.2.RELEASE |
Thanks for following up again @lRawd - just to be safe, could you give |
Duplicate of #1076 |
Uh oh!
There was an error while loading. Please reload this page.
Spring Session 2.0.3.RELEASE
After calling invalidate() on an HttpSession in an HTTP request, if later in that same request you have an HttpSession autowired into a bean, a session scoped bean, or call request.getSession(false), the HttpSession is recreated,
After invalidate() is called the Session object is removed from the repository and the current session attribute is removed from the request wrapper.
spring-session/spring-session-core/src/main/java/org/springframework/session/web/http/SessionRepositoryFilter.java
Line 396 in a39295c
However the request,getSession(false) call repopulates the current session attribute.
spring-session/spring-session-core/src/main/java/org/springframework/session/web/http/SessionRepositoryFilter.java
Line 307 in a39295c
When commitSession() is finally called current session is populated and it puts the session back into the repository.
spring-session/spring-session-core/src/main/java/org/springframework/session/web/http/SessionRepositoryFilter.java
Line 233 in a39295c
The text was updated successfully, but these errors were encountered: