Repository navigation
Conversation
jornane
force-pushed
the
fix/no-new-session
branch
from
September 17, 2026 18:02
1d2a2c5 to
b5bd1d4
Compare
Make $session in Auth\Simple nullable, and add getSession() function that will load the session if it was not set. Informative actions such as checking if the user is logged in will null check the session, and not call the function, to avoid starting a session. Actions that have side effects, such as redirecting to login, will use the function and thus start a session. Add $canCreate argument to Session::getSessionFromRequest, to allow retrieving a session only if it already exists, but avoid creating one if one doesn't exist already.
jornane
force-pushed
the
fix/no-new-session
branch
from
September 17, 2026 19:56
b5bd1d4 to
d35c572
Compare
Split getSessionFromRequest into two functions, one that will create a new session if one does not exist, and one that will return null if a session does not exist. This allows different functions to have separate `@return` signatures.
tvdijen
approved these changes
Sep 17, 2026
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.
Fix for #2684
Make
$sessioninAuth\Simplenullable, and addgetSession()function that will load the session if it was not set. Informative actions such as checking if the user is logged in will null check the session, and not call the function, to avoid starting a session. Actions that have side effects, such as redirecting to login, will use the function and thus start a session.Split
Session::getExistingSessionFromRequestfromSession::getSessionFromRequest, to allow retrieving a session only if it already exists, but avoid creating one if one doesn't exist already.