spring-projects / spring-projects/spring-session

Session.invalidate() prevent removing session attributes in redis.

Open
#634 1 comment 1 reaction 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

Hi guys,

Using spring session with redis here, when user logout, the code do the following things:
session.removeAttribute(user);
session.invalidate();
After that, I still can see the session attribute with value in redis!
But if session.invalidate() not called, the attribute value would be removed smoothly. But that's not what I want, the next user login should use a new session id in the same browser by invalidating the last.
Any ideas why?

THX
ling4

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

No source files or tests are identified in the issue. Start by reproducing the logout sequence with Redis-backed Spring Session and inspect the stored session before and after removeAttribute() and invalidate(); done means the invalidated session no longer retains the attribute and a subsequent login receives a new session ID.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, redis
Domain
authentication, backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.