diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2013-02-11 12:26:43 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2013-02-11 12:26:43 +0100 |
commit | 6efa9a2145a067d4034e24f86a0e0e37611472d3 (patch) | |
tree | 923b0095782ea8674d758720d95b5ab8fadded6c /Http | |
parent | 2790e9e0bdd27ca40c3a6a4a773ca14685ce4d82 (diff) | |
parent | 49342d68ed1dd7eec52d30cf40280996dca6873d (diff) | |
download | symfony-security-6efa9a2145a067d4034e24f86a0e0e37611472d3.zip symfony-security-6efa9a2145a067d4034e24f86a0e0e37611472d3.tar.gz symfony-security-6efa9a2145a067d4034e24f86a0e0e37611472d3.tar.bz2 |
Merge branch '2.1' into 2.2
* 2.1:
added support for the X-Forwarded-For header (closes #6982, closes #7000)
fixed the IP address in HttpCache when calling the backend
[EventDispatcher] Added assertion.
[EventDispathcer] Fix removeListener
[DependencyInjection] Add clone for resources which were introduced in 2.1
[DependencyInjection] Allow frozen containers to be dumped to graphviz
Fix 'undefined index' error, when entering scope recursively
[Security] fixed session creation on login (closes #7011)
Add dot character `.` to legal mime subtype regular expression
[HttpFoundation] fixed the creation of sub-requests under some circumstancies (closes #6923, closes #6936)
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 6c06ca8..8c71876 100644 --- a/Http/Firewall/ContextListener.php +++ b/Http/Firewall/ContextListener.php @@ -117,14 +117,16 @@ class ContextListener implements ListenerInterface } $request = $event->getRequest(); - $session = $request->hasPreviousSession() ? $request->getSession() : null; + $session = $request->getSession(); if (null === $session) { return; } if ((null === $token = $this->context->getToken()) || ($token instanceof AnonymousToken)) { - $session->remove('_security_'.$this->contextKey); + if ($request->hasPreviousSession()) { + $session->remove('_security_'.$this->contextKey); + } } else { $session->set('_security_'.$this->contextKey, serialize($token)); } |