Skip to content

Commit f95a62c

Browse files
Merge branch '4.4' into 5.0
* 4.4: Fix versions [Security/Http] Allow setting cookie security settings for delete_cookies [DI] fix generating TypedReference from PriorityTaggedServiceTrait [FrameworkBundle] revert to legacy wiring of the session when circular refs are detected bumped Symfony version to 3.4.40 updated VERSION for 3.4.39 update CONTRIBUTORS for 3.4.39 updated CHANGELOG for 3.4.39 [DomCrawler] Fix BC break in assertions breaking Panther [BrowserKit] fixed missing post request parameters in file uploads update Italian translation [Validator] Add missing Hungarian translations [Validator] Add the missing translations for the Arabic (ar) locale [Validator] Add missing vietnamese translations [Console] Fix OutputStream for PHP 7.4 add German translations bug #36157 [Validator] Assert Valid with many groups [Validator] Add missing Lithuanian translations Fixed some typos Add french "at least" constraint translations
2 parents 1f17d13 + ab96e60 commit f95a62c

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

Logout/CookieClearingLogoutHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(array $cookies)
3838
public function logout(Request $request, Response $response, TokenInterface $token)
3939
{
4040
foreach ($this->cookies as $cookieName => $cookieData) {
41-
$response->headers->clearCookie($cookieName, $cookieData['path'], $cookieData['domain']);
41+
$response->headers->clearCookie($cookieName, $cookieData['path'], $cookieData['domain'], isset($cookieData['secure']) ? $cookieData['secure'] : false, true, isset($cookieData['samesite']) ? $cookieData['samesite'] : null);
4242
}
4343
}
4444
}

Tests/Firewall/SwitchUserListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ public function testSwitchUserWithReplacedToken()
355355
$this->assertSame($replacedToken, $this->tokenStorage->getToken());
356356
}
357357

358-
public function testSwitchtUserThrowsAuthenticationExceptionIfNoCurrentToken()
358+
public function testSwitchUserThrowsAuthenticationExceptionIfNoCurrentToken()
359359
{
360360
$this->expectException('Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException');
361361
$this->tokenStorage->setToken(null);

Tests/Logout/CookieClearingLogoutHandlerTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Security\Http\Tests\Logout;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\HttpFoundation\Cookie;
1516
use Symfony\Component\HttpFoundation\Request;
1617
use Symfony\Component\HttpFoundation\Response;
1718
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
@@ -25,7 +26,7 @@ public function testLogout()
2526
$response = new Response();
2627
$token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
2728

28-
$handler = new CookieClearingLogoutHandler(['foo' => ['path' => '/foo', 'domain' => 'foo.foo'], 'foo2' => ['path' => null, 'domain' => null]]);
29+
$handler = new CookieClearingLogoutHandler(['foo' => ['path' => '/foo', 'domain' => 'foo.foo', 'secure' => true, 'samesite' => Cookie::SAMESITE_STRICT], 'foo2' => ['path' => null, 'domain' => null]]);
2930

3031
$cookies = $response->headers->getCookies();
3132
$this->assertCount(0, $cookies);
@@ -39,12 +40,16 @@ public function testLogout()
3940
$this->assertEquals('foo', $cookie->getName());
4041
$this->assertEquals('/foo', $cookie->getPath());
4142
$this->assertEquals('foo.foo', $cookie->getDomain());
43+
$this->assertEquals(Cookie::SAMESITE_STRICT, $cookie->getSameSite());
44+
$this->assertTrue($cookie->isSecure());
4245
$this->assertTrue($cookie->isCleared());
4346

4447
$cookie = $cookies['']['/']['foo2'];
4548
$this->assertStringStartsWith('foo2', $cookie->getName());
4649
$this->assertEquals('/', $cookie->getPath());
4750
$this->assertNull($cookie->getDomain());
51+
$this->assertNull($cookie->getSameSite());
52+
$this->assertFalse($cookie->isSecure());
4853
$this->assertTrue($cookie->isCleared());
4954
}
5055
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": "^7.2.5",
2020
"symfony/security-core": "^4.4|^5.0",
21-
"symfony/http-foundation": "^4.4|^5.0",
21+
"symfony/http-foundation": "^4.4.7|^5.0.7",
2222
"symfony/http-kernel": "^4.4|^5.0",
2323
"symfony/property-access": "^4.4|^5.0"
2424
},

0 commit comments

Comments
 (0)