diff options
author | Nicolas Grekas <nicolas.grekas@gmail.com> | 2016-07-17 16:08:33 +0200 |
---|---|---|
committer | Nicolas Grekas <nicolas.grekas@gmail.com> | 2016-07-17 16:08:33 +0200 |
commit | 78c56e9a88e7931d6cff778de8bd948be2e18794 (patch) | |
tree | 8174053a85887e2b31b421fc83601f9847e6b4d5 /Http/Authentication | |
parent | 444324ee4c32a70d394f8434e88867ccfa7c5bc0 (diff) | |
parent | 7bd9e9947f8fc1e9b0df21a4bb69e588133316f5 (diff) | |
download | symfony-security-78c56e9a88e7931d6cff778de8bd948be2e18794.zip symfony-security-78c56e9a88e7931d6cff778de8bd948be2e18794.tar.gz symfony-security-78c56e9a88e7931d6cff778de8bd948be2e18794.tar.bz2 |
Merge branch '3.1'
* 3.1:
[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)"
[Serializer] Include the format in the cache key
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
Conflicts:
src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php
src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
Diffstat (limited to 'Http/Authentication')
-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); } |