-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
NativeSessionStorage::regenerate bug #8460
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
Comments
This PR was merged into the 2.2 branch. Discussion ---------- [HttpFoundation] fixed issue with session_regenerate_id (closes #7380) | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #7380 | License | MIT | Doc PR | n/a Commits ------- 77f2aa8 [HttpFoundation] fixed issue with session_regenerate_id (closes #7380)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #8479). Discussion ---------- [HttpFoundation] Fixed NativeSessionStorage:regenerate when does not exists | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #8460 | License | MIT | Doc PR | - **warning** I did not try to reproduce this bug, so I am not sure it fixes the issue. I just open a PR with the suggested patch. Tests for http foundation are OK. I am not sur it's the best way to fix this issue as I do not understand why symfony reach this code if $_SESSION is not set. Commits ------- f5d59fb [HttpFoundation] Fixed NativeSessionStorage:regenerate when does not exists
Please reopen the bug! With your fix I have now: If session is not already started do not start one. The right fix is that is working for me:
|
fixed in symfony 2.3.4 👍 |
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #8969). Discussion ---------- [HttpFoundation] NativeSessionStorage regenerate | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #8460 | License | MIT | Doc PR | Since session_start is called by the regenerate function, then the 'started' flag of NativeSessionStorage have to be set to true. Otherwise, the variable $_SESSION is initiated and the exception "Failed to start the session: already started by PHP ($_SESSION is set)." is thrown. This can be reproduced by clearing the session data (cookies) before authenticating with a method that does not require csrf (eg. using the confirmation link of FOSUserBundle). Commits ------- 7a0eeb3 [HttpFoundation] NativeSessionStorage regenerate
For reference it's actually 2.3.5 that contains the workaround. |
This fix is about 6a15a3a
Also refer to: #7380
This fix is not valid because it generate another bug if _SESSION is not set! ($_SESSION is not defined)
I've modified code to this:
Please fix it.
The case happened for me when having no cookie/ PHPSESSID, using FOSUserBundle on http://BASE_URL/register/confirm/TOKEN
Thanks
The text was updated successfully, but these errors were encountered: