Skip to content

Commit 1d00c5c

Browse files
committed
bugfix: catch InvalidStateException in validate()
1 parent 26c53b9 commit 1d00c5c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

core/src/main/java/org/apache/shiro/session/mgt/AbstractValidatingSessionManager.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,18 @@ protected void validate(Session session, SessionKey key) throws InvalidSessionEx
140140
try {
141141
doValidate(session);
142142
} catch (ExpiredSessionException ese) {
143-
onExpiration(session, ese, key);
143+
try {
144+
onExpiration(session, ese, key);
145+
} catch (IllegalStateException eise) {
146+
LOGGER.trace("Attempting to validate an expired session with key {}", key, eise);
147+
}
144148
throw ese;
145149
} catch (InvalidSessionException ise) {
146-
onInvalidation(session, ise, key);
150+
try {
151+
onInvalidation(session, ise, key);
152+
} catch (IllegalStateException eise) {
153+
LOGGER.trace("Attempting to validate session with key {}", key, eise);
154+
}
147155
throw ise;
148156
}
149157
}

0 commit comments

Comments
 (0)