diff --git a/web/src/main/java/org/springframework/security/web/session/HttpSessionEventPublisher.java b/web/src/main/java/org/springframework/security/web/session/HttpSessionEventPublisher.java index a5c656c768e..76afe2d85cf 100644 --- a/web/src/main/java/org/springframework/security/web/session/HttpSessionEventPublisher.java +++ b/web/src/main/java/org/springframework/security/web/session/HttpSessionEventPublisher.java @@ -74,6 +74,16 @@ public void sessionDestroyed(HttpSessionEvent event) { extracted(event.getSession(), new HttpSessionDestroyedEvent(event.getSession())); } + /** + * Handles the HttpSessionEvent by publishing a {@link HttpSessionIdChangedEvent} + * to the application context when the session ID changes. + * + *
The event captures both the old session ID and the new session ID + * (retrieved from the current session) for use by listeners. + * + * @param event the HttpSessionEvent passed in by the container + * @param oldSessionId the previous session ID before the change + */ @Override public void sessionIdChanged(HttpSessionEvent event, String oldSessionId) { extracted(event.getSession(), new HttpSessionIdChangedEvent(event.getSession(), oldSessionId));