Skip to content

Commit

Permalink
HTTP: Fix sending Set-Cookie HTTP header
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansenDatabay authored and chfsx committed Sep 13, 2024
1 parent 7e5f36a commit 2d5fce5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/HTTP/Response/Sender/DefaultResponseSenderStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@ public function sendResponse(ResponseInterface $response): void

//render all headers
foreach (array_keys($response->getHeaders()) as $key) {
header("$key: " . $response->getHeaderLine($key));
// See Mantis #37385.
if (strtolower($key) === 'set-cookie') {
foreach ($response->getHeader($key) as $header) {
header("$key: " . $header, false);
}
} else {
header("$key: " . $response->getHeaderLine($key));
}
}

//rewind body stream
Expand Down

0 comments on commit 2d5fce5

Please sign in to comment.