mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-26 08:59:09 +00:00
Merge branch '7.0.x'
This commit is contained in:
+10
-2
@@ -251,7 +251,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
|
||||
|
||||
private @Nullable HttpSession session;
|
||||
|
||||
private boolean requestedSessionIdValid = true;
|
||||
private @Nullable Boolean requestedSessionIdValid;
|
||||
|
||||
private boolean requestedSessionIdFromCookie = true;
|
||||
|
||||
@@ -1352,7 +1352,15 @@ public class MockHttpServletRequest implements HttpServletRequest {
|
||||
|
||||
@Override
|
||||
public boolean isRequestedSessionIdValid() {
|
||||
return this.requestedSessionIdValid;
|
||||
if (this.requestedSessionIdValid != null) {
|
||||
return this.requestedSessionIdValid;
|
||||
}
|
||||
String requestedId = getRequestedSessionId();
|
||||
if (requestedId == null) {
|
||||
return false;
|
||||
}
|
||||
HttpSession currentSession = getSession(false);
|
||||
return (currentSession != null && requestedId.equals(currentSession.getId()));
|
||||
}
|
||||
|
||||
public void setRequestedSessionIdFromCookie(boolean requestedSessionIdFromCookie) {
|
||||
|
||||
Reference in New Issue
Block a user