Skip to content

Commit 1e859f6

Browse files
Merge branch '3.4' into 4.0
* 3.4: [Console] fix CS [OptionResolver] resolve arrays [TwigBridge] Fix missing path and separators in loader paths list on debug:twig output [PropertyInfo] Fix dock block lookup fallback loop [HttpFoundation] don't encode cookie name for BC improve deprecation messages minor #27858 [Console] changed warning verbosity; fixes typo (adrian-enspired) AppBundle->App. [DI] Fix dumping ignore-on-uninitialized references to synthetic services
2 parents c2dbb55 + 2654436 commit 1e859f6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Response.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,17 @@ public function sendHeaders()
329329
}
330330

331331
// headers
332-
foreach ($this->headers->allPreserveCase() as $name => $values) {
332+
foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) {
333333
foreach ($values as $value) {
334334
header($name.': '.$value, false, $this->statusCode);
335335
}
336336
}
337337

338+
// cookies
339+
foreach ($this->headers->getCookies() as $cookie) {
340+
header('Set-Cookie: '.$cookie->getName().strstr($cookie, '='), false, $this->statusCode);
341+
}
342+
338343
// status
339344
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
340345

Tests/Fixtures/response-functional/cookie_urlencode.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Array
44
[0] => Content-Type: text/plain; charset=utf-8
55
[1] => Cache-Control: no-cache, private
66
[2] => Date: Sat, 12 Nov 1955 20:04:00 GMT
7-
[3] => Set-Cookie: %3F%2A%28%29%3A%40%26%2B%24%2F%25%23%5B%5D=%3F%2A%28%29%3A%40%26%2B%24%2F%25%23%5B%5D; path=/
7+
[3] => Set-Cookie: ?*():@&+$/%#[]=%3F%2A%28%29%3A%40%26%2B%24%2F%25%23%5B%5D; path=/
88
[4] => Set-Cookie: ?*():@&+$/%#[]=%3F%2A%28%29%3A%40%26%2B%24%2F%25%23%5B%5D; path=/
99
)
1010
shutdown

0 commit comments

Comments
 (0)