Skip to content

InMemoryWebSessionStore Leaks Memory [SPR-15963] #20515

@spring-projects-issues

Description

@spring-projects-issues

Rob Winch opened SPR-15963 and commented

InMemoryWebSessionStore leaks expired sessions. There is code in DefaultWebSessionManger that cleans up an expired session but only if the user makes a request with that expired session. This means that if a user creates a session and just closes the browser tab without logging out, the session is never deleted.

Another problem is that relying on DefaultWebSessionManger to clean up the expired session is leaking implementation details. If someone wrote their own WebSessionManager and did not clean up the expired sessions within it, the problem would be even worse.

I think it would be better if InMemoryWebSessionStore knew how to clean up its own sessions (both the ones that are accessed and the ones that are never accessed again).


Affects: 5.0 RC4

Issue Links:

Referenced from: commits ec5969c, cb2decc, 6da3518

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions