Repository navigation
Keep redirect chains out of the session and use the framework session API - #45
Merged
Merged
Conversation
rrr63
reviewed
Nov 2, 2026
Comment on lines
-28
to
33
| if (isset($_SESSION)) { | ||
| $sessionData = $_SESSION; | ||
| unset($sessionData['password'], $sessionData['_token']); | ||
| $sanitizer = $this->sanitizer(); | ||
| $this->data['session_data'] = $sanitizer->sanitize($sessionData); | ||
| } | ||
| $sessionData = $request->session()->all(); | ||
| unset($sessionData['password'], $sessionData['_token']); | ||
|
|
||
| $sanitizer = $this->sanitizer(); | ||
| $this->data['session_data'] = $sanitizer->sanitize($sessionData); | ||
| } |
Member
There was a problem hiding this comment.
on SessionCollector::start() the old isset($_SESSION) guard was dropped — if no session was ever started, the fallback Session binds &$_SESSION (null) and all() array shouldthrows an error ? that is a case we should still guard against (e.g. try/catch)
Member
|
thank you @techmahedy |
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.
Summary
Insight read and wrote
$_SESSIONdirectly and calledsession_start(). That stops working once the framework session is no longer backed by PHP's native session, and the redirect chain it stored could not fit in a cookie-based session.Problem
SessionCollector,ProfilerMiddleware, andProfileraccessed$_SESSIONandsession_start()directly.cookiedriver, whose limit is about 4 KB, a request that issued a few dozen queries and then redirected caused aSessionException.What changed
$request->session(). This also works with earlier framework versions.Profiler::getRedirectChain()resolves those IDs from Insight's own storage, where every profile is already persisted.