feat(http)!: regenerate the session identifier on authentication - #2284
feat(http)!: regenerate the session identifier on authentication#2284osbre wants to merge 2 commits into
Conversation
Benchmark ResultsComparison of Open to see the benchmark results
Generated by phpbench against commit 9321d08 |
brendt
left a comment
There was a problem hiding this comment.
Why not add the regenerate logic in the manager class?
|
Since
It doesn't seem to be storage-specific, so all three managers would end up repeating the same code. It would also mean injecting the |
|
I agree with @osbre regarding the responsibility of I cleaned the API a bit by renaming methods to better names, and removing One thing I don't like but don't have a solution for is If you have any idea, I'll take it; otherwise we can just keep it as |
The session identifier used to survive authentication, so an identifier an attacker planted before login stayed valid afterwards and granted them the authenticated session.
SessionRegeneratorassigns a new identifier to the current session and destroys the session it replaces.SessionAuthenticatorcalls it when authenticating and deauthenticating.This is what OWASP ASVS 5.0 requires under 7.2.4 at level 1, including the termination of the previous token, and what both Laravel and Symfony do by default.
Breaking changes
SessionIdResolvergains aregenerate()method, which custom resolvers must implement.SessionAuthenticatorno longer takes aSessionManager, and takes aSessionRegeneratorinstead.