File tree 1 file changed +3
-1
lines changed
spring-session-core/src/main/java/org/springframework/session/web/http
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 76
76
* @author Rob Winch
77
77
* @author Vedran Pavic
78
78
* @author Josh Cummings
79
+ * @author Yanming Zhou
79
80
*/
80
81
@ Order (SessionRepositoryFilter .DEFAULT_ORDER )
81
82
public class SessionRepositoryFilter <S extends Session > extends OncePerRequestFilter {
@@ -222,10 +223,11 @@ private void commitSession() {
222
223
}
223
224
else {
224
225
S session = wrappedSession .getSession ();
226
+ String requestedSessionId = getRequestedSessionId (); // assign before clearRequestedSessionCache() for later use
225
227
clearRequestedSessionCache ();
226
228
SessionRepositoryFilter .this .sessionRepository .save (session );
227
229
String sessionId = session .getId ();
228
- if (!isRequestedSessionIdValid () || !sessionId .equals (getRequestedSessionId () )) {
230
+ if (!isRequestedSessionIdValid () || !sessionId .equals (requestedSessionId )) {
229
231
SessionRepositoryFilter .this .httpSessionIdResolver .setSessionId (this , this .response , sessionId );
230
232
}
231
233
}
You can’t perform that action at this time.
0 commit comments