Skip to content

Commit 5d74d95

Browse files
committed
Creating an empty session should save that session in the thread local.
So that a call to findSession doesn't unnecessarily attempt to retrieve it from Redis. This is an unexpected order of operations to support, but the Tomcat Manager app is doing it, so clearly it's possible.
1 parent 8170113 commit 5d74d95

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/com/radiadesign/catalina/session/RedisSessionManager.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ This ensures that the save(session) at the end of the request
280280

281281
session.setId(sessionId);
282282
session.tellNew();
283+
284+
currentSession.set(session);
285+
currentSessionId.set(sessionId);
286+
currentSessionIsPersisted.set(false);
283287
} finally {
284288
if (jedis != null) {
285289
returnConnection(jedis, error);

0 commit comments

Comments
 (0)