spring-session icon indicating copy to clipboard operation
spring-session copied to clipboard

SortedSetRedisSessionExpirationStore touches Session itself instead of its expires key

Open mrfilipenko opened this issue 4 months ago • 2 comments

Describe the bug SortedSetRedisSessionExpirationStore touches session itself instead of its expires key, so no Redis key event fires.

Expected behavior Since RedisIndexedSessionRepository#onMessage listens for key events on pattern this.namespace + "sessions:expires:", SortedSetRedisSessionExpirationStore#cleanupExpiredSessions should touch expires keys instead of sessions themselves just like RedisIndexedSessionRepository.MinuteBasedRedisSessionExpirationStore or ReactiveRedisIndexedSessionRepository + SortedSetReactiveRedisSessionExpirationStore does.

I think the bug arises from the fact that SortedSetRedisSessionExpirationStore does not store expires:sessionId format in the sorted set, like the RedisIndexedSessionRepository.MinuteBasedRedisSessionExpirationStore, but only the sessionId; SortedSetReactiveRedisSessionExpirationStore does not store expires:sessionId either, just sessionId, but that is compensated in ReactiveRedisIndexedSessionRepository#cleanUpExpiredSessions where the sessionId is put into the expires key format.

mrfilipenko avatar Aug 28 '25 12:08 mrfilipenko