spring-projects / spring-projects/spring-session
Last access time should never decrease
Nobody has claimed this yet.
- 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
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 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