diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2013-02-04 17:20:47 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2013-02-04 18:59:58 +0100 |
commit | 1c556ad72cfb835726456d1ef63664a105b9ddf2 (patch) | |
tree | 63d696bca929dad3db63c3dd0763954f66372437 /Http | |
parent | 7561b128e4d69b9a3d801209970a780c3d416b01 (diff) | |
download | symfony-security-1c556ad72cfb835726456d1ef63664a105b9ddf2.zip symfony-security-1c556ad72cfb835726456d1ef63664a105b9ddf2.tar.gz symfony-security-1c556ad72cfb835726456d1ef63664a105b9ddf2.tar.bz2 |
[Security] fixed session creation when none is needed (closes #6917)
Diffstat (limited to 'Http')
-rw-r--r-- | Http/Firewall/ContextListener.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Http/Firewall/ContextListener.php b/Http/Firewall/ContextListener.php index fddd3c7..b3f80b5 100644 --- a/Http/Firewall/ContextListener.php +++ b/Http/Firewall/ContextListener.php @@ -70,7 +70,6 @@ class ContextListener implements ListenerInterface } $request = $event->getRequest(); - $session = $request->hasPreviousSession() ? $request->getSession() : null; if (null === $session || null === $token = $session->get('_security_'.$this->contextKey)) { @@ -117,7 +116,10 @@ class ContextListener implements ListenerInterface $this->logger->debug('Write SecurityContext in the session'); } - if (null === $session = $event->getRequest()->getSession()) { + $request = $event->getRequest(); + $session = $request->hasPreviousSession() ? $request->getSession() : null; + + if (null === $session) { return; } |