Skip to content

Commit e86c8c0

Browse files
Do not wipe out current session when calling findSession and no session is found
1 parent 14dfbc8 commit e86c8c0

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java

+1-9
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,7 @@ public Session findSession(String id) throws IOException {
422422
RedisSession session = null;
423423

424424
if (null == id) {
425-
currentSessionIsPersisted.set(false);
426-
currentSession.set(null);
427-
currentSessionSerializationMetadata.set(null);
428-
currentSessionId.set(null);
425+
return null;
429426
} else if (id.equals(currentSessionId.get())) {
430427
session = currentSession.get();
431428
} else {
@@ -437,11 +434,6 @@ public Session findSession(String id) throws IOException {
437434
currentSessionSerializationMetadata.set(container.metadata);
438435
currentSessionIsPersisted.set(true);
439436
currentSessionId.set(id);
440-
} else {
441-
currentSessionIsPersisted.set(false);
442-
currentSession.set(null);
443-
currentSessionSerializationMetadata.set(null);
444-
currentSessionId.set(null);
445437
}
446438
}
447439

0 commit comments

Comments
 (0)