-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Cookie-Names are prefixed with "Set-Cookie:" by AbstractSessionHandler::destroy #25393
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
Do you want to provide the Pull Request ? |
Does #25398 work? |
nicolas-grekas
added a commit
that referenced
this issue
Dec 8, 2017
…pableu) This PR was merged into the 3.4 branch. Discussion ---------- [HttpFoundation] don't prefix cookies with "Set-Cookie:" | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | ? | Fixed tickets | #25393 | License | MIT Commits ------- a4db20f [HttpFoundation] don't prefix cookies with "Set-Cookie:"
symfony-splitter
pushed a commit
to symfony/http-foundation
that referenced
this issue
Dec 8, 2017
Perfectly, thank's for it, and congrats for your first PR! |
Congrats for the first PR ! |
Great! Thanks for accepting it so quickly :-) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When creating cookies using setcookie() whilst having a session started, our own cookies are prefixed by "Set-Cookie".
I think the issue becomes quite obvious by reading AbstractSessionHandler::destroy:
symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/AbstractSessionHandler.php
Line 159 in ecf54d5
In line 143, all headers that don't start with "Set-Cookie:" are skipped. Then in Lines 150 and 153, they are added to
$otherCookies
.In line 159, they are prefixed again with "Set-Cookie:" and passed to
header()
. This results in headers such asSet-Cookie: Set-Cookie: test=foo; path=/
.I think the correct solution would be to change line 159 to
header($h, false);
.Symfony Version: 3.4.1
PHP-Version: 7.0.22
OS: Ubuntu 16.04
Some Screenshots from the Chrome Devtools:


Headers:
Cookies:
The text was updated successfully, but these errors were encountered: