Skip to content

Use cached requestedSession info if available #1578

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,11 @@ private void commitSession() {
}
else {
S session = wrappedSession.getSession();
String sessionId = session.getId();
boolean isRequestedSession = isRequestedSessionIdValid() && sessionId.equals(getRequestedSessionId());
clearRequestedSessionCache();
SessionRepositoryFilter.this.sessionRepository.save(session);
String sessionId = session.getId();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the sessionId allowed to change on save? In that case, the comparison should still be done after save, but requestedSessionId has to be retrieved before the clearRequestedSessionCache()

if (!isRequestedSessionIdValid() || !sessionId.equals(getRequestedSessionId())) {
if (!isRequestedSession) {
SessionRepositoryFilter.this.httpSessionIdResolver.setSessionId(this, this.response, sessionId);
}
}
Expand Down