spring-projects / spring-projects/spring-session
Non expiring sessions expiring after 5 minutes
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
Updating from spring-session 3.3.5 to 3.4.1 causes non expiring sessions to expire after 5 minutes of inactivity.
To Reproduce
- RedisIndexedSessionRepository configured with maxInactiveIntervalInSeconds = -1.
- Call rest controller to create new session.
- Inspect TTL on
spring:session:sessions:{{sessionId}}. TTL counts down from 300. - With 5 minutes of inactivity session will expire.
Expected behavior
From version 3.3.5 TTL of spring:session:sessions:{{sessionId}} remains -1.
The issue looks to be related to this commit, here.
Sample
https://github.com/nfawcett/spring-session-expiring-issue. Change versions to see difference in behaviour.
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 in spring-session-data-redis/src/main/java/org/springframework/session/data/redis/RedisIndexedSessionRepository.java around line 932, which the report links to, and reproduce the issue with maxInactiveIntervalInSeconds = -1. Compare the Redis TTL behavior between versions 3.3.5 and 3.4.1 using the linked sample project. Done means the session key's TTL remains -1 instead of counting down from 300.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, redis, spring
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100