You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using SpringSession with ChangeSessionIdAuthenticationStrategy the SessionRepositoryFilter's method, changeSessionId, is invoked. In this code the session variable and the original variable are a reference to the same object, so in the following code extracted from SessionRepositoryFilter.changeSessionId
in the second line we are effectively overwriting the internal session object of the same HttpSessionWrapper, referenced by our original AND session variables.
So in the third line we have lost the reference to the previously stored maxInactiveInterval value
The solution is as simply as
HttpSessionWrapper newSession = getSession(); int previousValue = session.getMaxInactiveInterval();
original.setSession(newSession.getSession());
newSession.setMaxInactiveInterval(previousValue);