spring-projects / spring-projects/spring-session

Non expiring sessions expiring after 5 minutes

Open
#3,320 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

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.