[HttpFoundation] don't prefix cookies with "Set-Cookie:"

See symfony/symfony#25393
This commit is contained in:
Pablo Schläpfer 2017-12-08 14:05:42 +01:00 committed by Nicolas Grekas
parent ecf54d5aa0
commit a4db20fbfd
3 changed files with 38 additions and 1 deletions

View File

@ -156,7 +156,7 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess
if ($sessionCookieFound) {
header_remove('Set-Cookie');
foreach ($otherCookies as $h) {
header('Set-Cookie:'.$h, false);
header($h, false);
}
} else {
setcookie($this->sessionName, '', 0, ini_get('session.cookie_path'), ini_get('session.cookie_domain'), ini_get('session.cookie_secure'), ini_get('session.cookie_httponly'));

View File

@ -0,0 +1,24 @@
open
validateId
read
doRead: abc|i:123;
read
updateTimestamp
close
open
validateId
read
doRead: abc|i:123;
read
write
destroy
doDestroy
close
Array
(
[0] => Content-Type: text/plain; charset=utf-8
[1] => Cache-Control: max-age=10800, private, must-revalidate
[2] => Set-Cookie: abc=def
)
shutdown

View File

@ -0,0 +1,13 @@
<?php
require __DIR__.'/common.inc';
setcookie('abc', 'def');
session_set_save_handler(new TestSessionHandler('abc|i:123;'), false);
session_start();
session_write_close();
session_start();
$_SESSION['abc'] = 234;
unset($_SESSION['abc']);