spring-projects / spring-projects/spring-session

Reconsider handling of SessionRepository#save for invalidated sessions

Open
#1,277 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: core
Dominant language
Java
Stars
1.9k
Forks
1.2k
Avg merge
4h 27m
Merged PRs (30d)
55

Description

At present, the SessionRepository implementations are silent when an invalid session is passed to #save operation. This can have unexpected consequences in further processing of HTTP request, since it operates under assumption that the saved session is still valid - i.e. there's no difference in #save when passed in session is valid vs invalid.

One option could be (depending on the nature of the underlying data store) to do a read before saving a session, and throw an error if session is missing/invalid.

We could look at WebSession#save for inspiration - see #1135.

/cc @rwinch @jxblum @gregturn

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

Review the SessionRepository implementations and WebSession#save, using issue #1135 for context. Determine the intended behavior when #save receives an invalid session and how it depends on the underlying data store; the work is done when that behavior and its error handling are agreed and consistently covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.