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
Copy file name to clipboardExpand all lines: spring-session-core/src/main/java/org/springframework/session/web/http/SessionRepositoryFilter.java
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -309,6 +309,10 @@ public HttpSessionWrapper getSession(boolean create) {
309
309
if (!create) {
310
310
returnnull;
311
311
}
312
+
if (SessionRepositoryFilter.this.httpSessionIdResolverinstanceofCookieHttpSessionIdResolver
313
+
&& this.response.isCommitted()) {
314
+
thrownewIllegalStateException("Cannot create a session after the response has been committed");
315
+
}
312
316
if (SESSION_LOGGER.isDebugEnabled()) {
313
317
SESSION_LOGGER.debug(
314
318
"A new session was created. To help you troubleshoot where the session was created we provided a StackTrace (this is not an error). You can prevent this from appearing by disabling DEBUG logging for "
0 commit comments