-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
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
header('Set-Cookie:'.$h, false); |
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 as Set-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: