spring-projects / spring-projects/spring-session

invalidate does not work on session objects handed out to HttpSessionListener

Open
#738 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

Using Spring Session 1.3.0

If a HttpSessionListener is added, it correctly gets events sent to it by the Spring Session SessionEventHttpSessionListenerAdapter.

However, if the listener then calls invalidate() on the session object received, then nothing happens.

The code in SessionEventHttpSessionListenerAdapter.createHttpSessionEvent looks fishy, it just does a new ExpiringSessionHttpSession, that object is in no way connected to the rest of Spring Session.

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 SessionEventHttpSessionListenerAdapter.createHttpSessionEvent and inspect how the new ExpiringSessionHttpSession is connected to the underlying Spring Session. Reproduce a listener calling invalidate() on the received session; done means invalidation affects the corresponding Spring Session rather than doing nothing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.