Skip to content

Commit ebe0c11

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: Remove 6.3 EOLed from Github template [Mailer] [Mailgun] Fix payload converter getReason [HttpFoundation] Fix clearing CHIPS cookies [AssetMapper] Turn debug on by default [AssetMapper] Fix JavaScript compiler load imports from JS strings [Notifier][Smsapi] Better docs for .com endpoint Fix exception if assets dir is missing in prod Update VERSION for 6.3.12 Update CHANGELOG for 6.3.12 Bump Symfony version to 5.4.36 Update VERSION for 5.4.35 Update CONTRIBUTORS for 5.4.35 Update CHANGELOG for 5.4.35
2 parents f24e256 + d68e699 commit ebe0c11

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

ResponseHeaderBag.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,14 @@ public function getCookies(string $format = self::COOKIES_FLAT): array
216216

217217
/**
218218
* Clears a cookie in the browser.
219+
*
220+
* @param bool $partitioned
219221
*/
220-
public function clearCookie(string $name, ?string $path = '/', ?string $domain = null, bool $secure = false, bool $httpOnly = true, ?string $sameSite = null): void
222+
public function clearCookie(string $name, ?string $path = '/', ?string $domain = null, bool $secure = false, bool $httpOnly = true, ?string $sameSite = null /* , bool $partitioned = false */): void
221223
{
222-
$this->setCookie(new Cookie($name, null, 1, $path, $domain, $secure, $httpOnly, false, $sameSite));
224+
$partitioned = 6 < \func_num_args() ? \func_get_arg(6) : false;
225+
226+
$this->setCookie(new Cookie($name, null, 1, $path, $domain, $secure, $httpOnly, false, $sameSite, $partitioned));
223227
}
224228

225229
/**

Tests/ResponseHeaderBagTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@ public function testClearCookieSamesite()
136136
$this->assertSetCookieHeader('foo=deleted; expires='.gmdate('D, d M Y H:i:s T', time() - 31536001).'; Max-Age=0; path=/; secure; samesite=none', $bag);
137137
}
138138

139+
public function testClearCookiePartitioned()
140+
{
141+
$bag = new ResponseHeaderBag([]);
142+
143+
$bag->clearCookie('foo', '/', null, true, false, 'none', true);
144+
$this->assertSetCookieHeader('foo=deleted; expires='.gmdate('D, d M Y H:i:s T', time() - 31536001).'; Max-Age=0; path=/; secure; samesite=none; partitioned', $bag);
145+
}
146+
139147
public function testReplace()
140148
{
141149
$bag = new ResponseHeaderBag([]);

0 commit comments

Comments
 (0)