Repository navigation
Regenerate the session id on login - #5
Merged
Merged
Conversation
Module::login () gives the session a new id right before the user id is stored. The session data (post-login redirect) is kept. Uses Session::regenerate () where the installed Neuron has it, and session_regenerate_id (true) on an active session otherwise, so the Neuron constraint (>=3.0.0) does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DqZUi2UiBJP6rZoCSRcdpE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Module::login()gives the session a new id right before the user id is stored in it. The stored session of the old id is removed.statehas already been checked and removed byBasicFlowat that point.Session::regenerate()when the installed Neuron has that method (added in Sessions: validate ids, opt-in query parameter, expiry, regenerate() Neuron#14). On older Neuron versions it callssession_regenerate_id(true)itself, when a session is active and the session cookie can still be sent. Thecatlabinteractive/neuronconstraint (>=3.0.0) is unchanged.Compatibility
No API change. After login the browser receives a new session cookie; code that kept the pre-login session id somewhere else will no longer find that session.
Tests
tests/ModuleTest.php: the id is regenerated once, before the identity is stored, and the return URL survives; a login without an active session does not start one.🤖 Generated with Claude Code
https://claude.ai/code/session_01DqZUi2UiBJP6rZoCSRcdpE