Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit b2e6411

Browse files
committed
[Security] Delete old session on auth strategy migrate
1 parent 460c9c4 commit b2e6411

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Http/Session/SessionAuthenticationStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function onAuthentication(Request $request, TokenInterface $token)
4747
return;
4848

4949
case self::MIGRATE:
50-
$request->getSession()->migrate();
50+
$request->getSession()->migrate(true);
5151

5252
return;
5353

Tests/Http/Session/SessionAuthenticationStrategyTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testUnsupportedStrategy()
4747
public function testSessionIsMigrated()
4848
{
4949
$session = $this->getMock('Symfony\Component\HttpFoundation\Session\SessionInterface');
50-
$session->expects($this->once())->method('migrate');
50+
$session->expects($this->once())->method('migrate')->with($this->equalTo(true));
5151

5252
$strategy = new SessionAuthenticationStrategy(SessionAuthenticationStrategy::MIGRATE);
5353
$strategy->onAuthentication($this->getRequest($session), $this->getToken());

0 commit comments

Comments
 (0)