Skip to content

GH-3471: Remove old session id from expiration store on change - #3887

Open
kalayciburak wants to merge 1 commit into
spring-projects:3.5.xfrom
kalayciburak:fix/gh-3471-remove-old-session-from-expiration-store
Open

GH-3471: Remove old session id from expiration store on change#3887
kalayciburak wants to merge 1 commit into
spring-projects:3.5.xfrom
kalayciburak:fix/gh-3471-remove-old-session-from-expiration-store

Conversation

@kalayciburak

Copy link
Copy Markdown

Summary

When ReactiveRedisIndexedSessionRepository saves a session after changeSessionId(), session and expires keys are renamed and indexes are updated, but the original session id is left in the expiration sorted set. Over time those stale members accumulate and interfere with cleanup (see #3471).

This change removes the original session id from the expiration store during saveChangeSessionId(), matching the non-reactive RedisIndexedSessionRepository behavior. The subsequent expirationStore.add(...) on save still registers the new session id.

Test plan

  • ./gradlew :spring-session-data-redis:test --tests org.springframework.session.data.redis.ReactiveRedisIndexedSessionRepositoryTests (RED before fix: WantedButNotInvoked on expirationStore.remove; GREEN after)
  • ./gradlew :spring-session-data-redis:test (module unit suite GREEN)
  • ./gradlew :spring-session-data-redis:format

Fixes #3471

…n change

When ReactiveRedisIndexedSessionRepository renames a session after
changeSessionId, remove the original id from the expiration sorted set
so stale entries cannot accumulate. Mirrors RedisIndexedSessionRepository.

Signed-off-by: Burak Kalaycı <kalayciburak1996@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants