From e86c8c00d45f2c72ca74b806211f5ff558e42b8a Mon Sep 17 00:00:00 2001 From: Michael Cameron Date: Thu, 19 Feb 2015 10:13:00 -0600 Subject: [PATCH] Do not wipe out current session when calling findSession and no session is found --- .../tomcat/redissessions/RedisSessionManager.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java b/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java index 12af7308..0e89e541 100644 --- a/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java +++ b/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java @@ -422,10 +422,7 @@ public Session findSession(String id) throws IOException { RedisSession session = null; if (null == id) { - currentSessionIsPersisted.set(false); - currentSession.set(null); - currentSessionSerializationMetadata.set(null); - currentSessionId.set(null); + return null; } else if (id.equals(currentSessionId.get())) { session = currentSession.get(); } else { @@ -437,11 +434,6 @@ public Session findSession(String id) throws IOException { currentSessionSerializationMetadata.set(container.metadata); currentSessionIsPersisted.set(true); currentSessionId.set(id); - } else { - currentSessionIsPersisted.set(false); - currentSession.set(null); - currentSessionSerializationMetadata.set(null); - currentSessionId.set(null); } }