[HttpFoundation] Send cookies using header() to fix "SameSite" ones
This commit is contained in:
parent
a8d3012845
commit
e350ea000f
@ -327,7 +327,7 @@ class Response
|
|||||||
}
|
}
|
||||||
|
|
||||||
// headers
|
// headers
|
||||||
foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) {
|
foreach ($this->headers->allPreserveCase() as $name => $values) {
|
||||||
foreach ($values as $value) {
|
foreach ($values as $value) {
|
||||||
header($name.': '.$value, false, $this->statusCode);
|
header($name.': '.$value, false, $this->statusCode);
|
||||||
}
|
}
|
||||||
@ -336,15 +336,6 @@ class Response
|
|||||||
// status
|
// status
|
||||||
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
|
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
|
||||||
|
|
||||||
// cookies
|
|
||||||
foreach ($this->headers->getCookies() as $cookie) {
|
|
||||||
if ($cookie->isRaw()) {
|
|
||||||
setrawcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
|
|
||||||
} else {
|
|
||||||
setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user