spring-projects / spring-projects/spring-session

Last access time should never decrease

Open
#1,280 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
1.9k
Forks
1.2k
Avg merge
4h 27m
Merged PRs (30d)
55

Description

If a request takes a long time to service, such as a long-polling request or SSE (Server-Sent Events) request, SessionRepositoryFilter can update the session's last-access time with a very stale value, possibly longer even than the max-inactive interval. This would effectively expire the session.

A simple fix for the JDBC repository might be to change the update query to use LAST_ACCESS_TIME = max(LAST_ACCESS_TIME, ?).

I’m using 2.0.8. Problem also exists in master.

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 at SessionRepositoryFilter and trace how the JDBC repository writes the session's last-access time during long-running requests. Inspect the update query and determine how to prevent a stale value from replacing a newer one. Done means a long-polling or SSE request cannot move last-access time backward or prematurely expire the session.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, sql
Domain
backend, database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.