Skip to content

Commit e04c84a

Browse files
[HttpFoundation] Send cookies using header() to fix "SameSite" ones
1 parent b783602 commit e04c84a

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/Symfony/Component/HttpFoundation/Response.php

+1-10
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ public function sendHeaders()
337337
}
338338

339339
// headers
340-
foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) {
340+
foreach ($this->headers->allPreserveCase() as $name => $values) {
341341
foreach ($values as $value) {
342342
header($name.': '.$value, false, $this->statusCode);
343343
}
@@ -346,15 +346,6 @@ public function sendHeaders()
346346
// status
347347
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
348348

349-
// cookies
350-
foreach ($this->headers->getCookies() as $cookie) {
351-
if ($cookie->isRaw()) {
352-
setrawcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
353-
} else {
354-
setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
355-
}
356-
}
357-
358349
return $this;
359350
}
360351

0 commit comments

Comments
 (0)