spring-projects / spring-projects/spring-session
After `changeSessionId`, expirationStore(ordered set) lost the new sessionId
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 55
Description
Describe the bug
After changeSessionId, expirationStore(ordered set) lost the new sessionId
To Reproduce
- config
SortedSetRedisSessionExpirationStorefor expirationStore - Create a new session and save it
- FindById to get the previously saved session
- Call changeSessionId and save it
- You can see in the
expirationkv of redis that the new sessionId does not exist
Expected behavior
The old sessionId should be deleted and the new sessionId should be appended to the sorted set of redis
Source
How to fix
We can add a rename method to the RedisSessionExpirationStore interface
rename(String oldSessionId, String newSessionId, Integer expirationInMillis)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at RedisIndexedSessionRepository.java around line 994 and inspect the RedisSessionExpirationStore interface and its expiration-store implementations. Reproduce the changeSessionId flow with SortedSetRedisSessionExpirationStore, then verify that the old sessionId is removed and the new one is present in Redis's expiration sorted set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, redis, spring
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100