spring-projects / spring-projects/spring-session

Spring Redis Session - TTL gets reset back to original timeout when deleteSession attempt is made

Open
#3,184 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage type: bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.