Skip to content

Commit 0e74622

Browse files
joos-ediarwinch
authored andcommitted
Move log statement
Moved after removeSessionInformation() is called for comprehensible output to log file. The log statements are now written in correct order. Before the change, this could be confusing when debugging an application, since it seemed that the registered session was immediately removed when only looking at the logs.
1 parent f6ed1db commit 0e74622

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/src/main/java/org/springframework/security/core/session/SessionRegistryImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ public void registerNewSession(String sessionId, Object principal) {
120120
Assert.hasText(sessionId, "SessionId required as per interface contract");
121121
Assert.notNull(principal, "Principal required as per interface contract");
122122

123+
if (getSessionInformation(sessionId) != null) {
124+
removeSessionInformation(sessionId);
125+
}
126+
123127
if (logger.isDebugEnabled()) {
124128
logger.debug("Registering session " + sessionId + ", for principal "
125129
+ principal);
126130
}
127131

128-
if (getSessionInformation(sessionId) != null) {
129-
removeSessionInformation(sessionId);
130-
}
131-
132132
sessionIds.put(sessionId,
133133
new SessionInformation(principal, sessionId, new Date()));
134134

0 commit comments

Comments
 (0)