spring-projects / spring-projects/spring-session
Spring Redis Session - TTL gets reset back to original timeout when deleteSession attempt is made
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 55
Description
I'm not sure if this is expected behaviour, but if my session timeout is 5 minutes the timeout on the hashed key is 10 minutes (an extra 5 minutes)
However, when I try to delete a key, the key remains and only the lastAccessedTime is left in there. However the ttl gets reset to 5 / 10 minutes again.
Is that expeced behaviour? Would seem strange when trying to invalidate a 6 hour long session, with 1 hour left for it to get reset back to 6 hours again?
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior.
Expected behavior
A clear and concise description of what you expected to happen.
Sample
A link to a GitHub repository with a minimal, reproducible sample.
Reports that include a sample will take priority over reports that do not.
At times, we may require a sample, so it is good to try and include a sample up front.
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 with the Spring Redis session implementation and the deleteSession path described in the report. Reproduce the hashed-key TTL reset after deletion, then determine the expected expiration behavior and add a regression test showing that invalidation does not incorrectly restore the original timeout.
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
- Needs clarification
- Newbie friendliness
- 35/100