Skip to content

Enable support for persistent sessions when using SessionRegistryImpl #8368

Closed
@callmeberzerker

Description

@callmeberzerker

Summary

When you use spring-boot with devTools you get persistent servlet session out-of-the-box that is preserved across server restarts. (spring-projects/spring-boot#3530) That's all fine and dandy but the default org.springframework.security.core.session.SessionRegistryImpl is not aware of the principal as the registerNewSession(String sessionId, Object principal) is called ONLY during the onAuthentication process.

Actual Behavior

SessionRegistryImpl is not aware of restored session for principal.

Expected Behavior

SessionRegistryImplis populated when a session is restored from disk. Some earlier filter should register the session if not present in the registry would be something that makes most sense to me. (probably in SecurityContextPersistenceFilter.java)

Note

The issue is solvable in user-space with a custom filter but IMO there should not be any need for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webAn issue in web modules (web, webmvc)type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions