Update CustomHttpSessionListener.java

This commit is contained in:
Ludy87 2025-03-24 22:33:41 +01:00
parent 423013f032
commit aaa3739856
No known key found for this signature in database
GPG Key ID: 92696155E0220F94

View File

@ -42,6 +42,7 @@ public class CustomHttpSessionListener implements HttpSessionListener {
}
String principalName = UserUtils.getUsernameFromPrincipal(principal);
if (principalName == null || "anonymousUser".equals(principalName)) {
log.info("Principal is null or anonymousUser");
return;
}
log.info("Session created: {}", principalName);
@ -51,5 +52,6 @@ public class CustomHttpSessionListener implements HttpSessionListener {
@Override
public void sessionDestroyed(HttpSessionEvent se) {
sessionPersistentRegistry.expireSession(se.getSession().getId());
sessionPersistentRegistry.removeSessionInformation(se.getSession().getId());
}
}