diff options
author | Nicolas Grekas <nicolas.grekas@gmail.com> | 2016-07-17 11:06:15 +0200 |
---|---|---|
committer | Nicolas Grekas <nicolas.grekas@gmail.com> | 2016-07-17 11:06:15 +0200 |
commit | d46dc33fbe1f845398e90e36410965e8de71075c (patch) | |
tree | 4866413524b801ecaf2e0e05be77195ae3a068a5 | |
parent | 759ca4ca47c440efe2771359e5449c886ca1955a (diff) | |
parent | f2589f884f36fb6a5fbb678d9a4e1db1384efeff (diff) | |
download | symfony-security-d46dc33fbe1f845398e90e36410965e8de71075c.zip symfony-security-d46dc33fbe1f845398e90e36410965e8de71075c.tar.gz symfony-security-d46dc33fbe1f845398e90e36410965e8de71075c.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.php | 8 |
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); } |