[Security] Delete old session on auth strategy migrate
This commit is contained in:
parent
f79aa948e0
commit
5dd11e67a4
|
@ -47,7 +47,7 @@ class SessionAuthenticationStrategy implements SessionAuthenticationStrategyInte
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case self::MIGRATE:
|
case self::MIGRATE:
|
||||||
$request->getSession()->migrate();
|
$request->getSession()->migrate(true);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ class SessionAuthenticationStrategyTest extends \PHPUnit_Framework_TestCase
|
||||||
public function testSessionIsMigrated()
|
public function testSessionIsMigrated()
|
||||||
{
|
{
|
||||||
$session = $this->getMock('Symfony\Component\HttpFoundation\Session\SessionInterface');
|
$session = $this->getMock('Symfony\Component\HttpFoundation\Session\SessionInterface');
|
||||||
$session->expects($this->once())->method('migrate');
|
$session->expects($this->once())->method('migrate')->with($this->equalTo(true));
|
||||||
|
|
||||||
$strategy = new SessionAuthenticationStrategy(SessionAuthenticationStrategy::MIGRATE);
|
$strategy = new SessionAuthenticationStrategy(SessionAuthenticationStrategy::MIGRATE);
|
||||||
$strategy->onAuthentication($this->getRequest($session), $this->getToken());
|
$strategy->onAuthentication($this->getRequest($session), $this->getToken());
|
||||||
|
|
Reference in New Issue