summaryrefslogtreecommitdiffstats
path: root/Http/Authentication
diff options
context:
space:
mode:
authorNicolas Grekas <nicolas.grekas@gmail.com>2016-07-17 16:02:08 +0200
committerNicolas Grekas <nicolas.grekas@gmail.com>2016-07-17 16:02:08 +0200
commit7bd9e9947f8fc1e9b0df21a4bb69e588133316f5 (patch)
tree4ac5c1e3ddc53d08083fd9ae8bd7d791f779df9d /Http/Authentication
parentd00dcfed191df63f4b41303f81bd46b19fed80fa (diff)
parente00948e5ae59fb98477b8b9868aa00646e8d5e23 (diff)
downloadsymfony-security-7bd9e9947f8fc1e9b0df21a4bb69e588133316f5.zip
symfony-security-7bd9e9947f8fc1e9b0df21a4bb69e588133316f5.tar.gz
symfony-security-7bd9e9947f8fc1e9b0df21a4bb69e588133316f5.tar.bz2
Merge branch '3.0' into 3.1v3.1.3
* 3.0: [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 Conflicts: src/Symfony/Component/Yaml/Yaml.php
Diffstat (limited to 'Http/Authentication')
-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);
}