-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] fixed bag registration after session start #16136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
public function testRegisterBagAfterStarting() | ||
{ | ||
$storage = $this->getStorage(); | ||
$storage->start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a test to see what happens when you register before starting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, see above. Did you expect it this way?
* @param SessionBagInterface $bag | ||
* @param array|null $session | ||
*/ | ||
protected function loadSessionBag(SessionBagInterface $bag, array &$session = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be private.
Closing as the "right" fix would instead be to throw an exception when trying to register a bag after the session is started. |
…ed sessions (xabbuh) This PR was merged into the 2.3 branch. Discussion ---------- [HttpFoundation] exception when registering bags for started sessions | Q | A | ------------- | --- | Branch | 2.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #10707, #16136 | License | MIT | Doc PR | Commits ------- c4a5b67 exception when registering bags for started sessions
I suggested this fix some time ago, but there were no resoponses. Hopefully, this PR finds some attention 😃