summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Grekas <nicolas.grekas@gmail.com>2016-07-17 11:06:15 +0200
committerNicolas Grekas <nicolas.grekas@gmail.com>2016-07-17 11:06:15 +0200
commitd46dc33fbe1f845398e90e36410965e8de71075c (patch)
tree4866413524b801ecaf2e0e05be77195ae3a068a5
parent759ca4ca47c440efe2771359e5449c886ca1955a (diff)
parentf2589f884f36fb6a5fbb678d9a4e1db1384efeff (diff)
downloadsymfony-security-2.8.9.zip
symfony-security-2.8.9.tar.gz
symfony-security-2.8.9.tar.bz2
Merge branch '2.7' into 2.8v2.8.9
* 2.7: [VarDumper] Fix dumping jsons casted as arrays PassConfig::getMergePass is not an array Revert "bug #19114 [HttpKernel] Dont close the reponse stream in debug (nicolas-grekas)" Fix the retrieval of the last username when using forwarding [Yaml] Fix PHPDoc of the Yaml class [HttpFoundation] Add OPTIONS and TRACE to the list of safe methods Update getAbsoluteUri() for query string uris
-rw-r--r--Http/Authentication/AuthenticationUtils.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/Http/Authentication/AuthenticationUtils.php b/Http/Authentication/AuthenticationUtils.php
index 4d5c71a..c6397e8 100644
--- a/Http/Authentication/AuthenticationUtils.php
+++ b/Http/Authentication/AuthenticationUtils.php
@@ -65,7 +65,13 @@ class AuthenticationUtils
*/
public function getLastUsername()
{
- $session = $this->getRequest()->getSession();
+ $request = $this->getRequest();
+
+ if ($request->attributes->has(Security::LAST_USERNAME)) {
+ return $request->attributes->get(Security::LAST_USERNAME);
+ }
+
+ $session = $request->getSession();
return null === $session ? '' : $session->get(Security::LAST_USERNAME);
}