From b1d029384cef82e0143959a280615910a1785b25 Mon Sep 17 00:00:00 2001 From: 12OneTwo12 Date: Wed, 4 Dec 2024 16:03:24 +0900 Subject: [PATCH] Improve documentation for sessionIdChanged method --- .../web/session/HttpSessionEventPublisher.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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));