Skip to content

Commit f29505d

Browse files
beamerblvdrwinch
authored andcommitted
SEC-2280: Fix SessionFixationConfigurer#changeSessionId Javadoc
The Javadoc for SessionFixationConfigurer#changeSessionId() was copied and pasted from SessionFixationConfigurer#none() and never updated. It is incorrect. This commit fixes that.
1 parent 48283ec commit f29505d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

config/src/main/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurer.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,17 @@ public SessionManagementConfigurer<H> migrateSession() {
242242
}
243243

244244
/**
245-
* Specifies that no session fixation protection should be enabled. This
246-
* may be useful when utilizing other mechanisms for protecting against
247-
* session fixation. For example, if application container session
248-
* fixation protection is already in use. Otherwise, this option is not
249-
* recommended.
245+
* Specifies that the Servlet container-provided session fixation
246+
* protection should be used. When a session authenticates, the
247+
* Servlet 3.1 method {@code HttpServletRequest#changeSessionId()} is
248+
* called to change the session ID and retain all session attributes.
249+
* Using this option in a Servlet 3.0 or older container results in an
250+
* {@link IllegalStateException}.
250251
*
251252
* @return the {@link SessionManagementConfigurer} for further
252253
* customizations
254+
* @throws IllegalStateException if the container is not Servlet 3.1 or
255+
* newer.
253256
*/
254257
public SessionManagementConfigurer<H> changeSessionId() {
255258
setSessionFixationAuthenticationStrategy(new ChangeSessionIdAuthenticationStrategy());
@@ -451,4 +454,4 @@ private static SessionAuthenticationStrategy createDefaultSessionFixationProtect
451454
return new SessionFixationProtectionStrategy();
452455
}
453456
}
454-
}
457+
}

0 commit comments

Comments
 (0)