Преглед на файлове

Merge branch 'TICKET_9557' of https://github.com/cyqui/symfony into cyqui-TICKET_9557

Johannes Schmitt преди 14 години
родител
ревизия
e91cb7cf96
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php

+ 4 - 1
src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php

@@ -160,7 +160,10 @@ class ExceptionListener implements ListenerInterface
             $this->logger->debug('Calling Authentication entry point');
         }
 
-        $request->getSession()->set('_security.target_path', $request->getUri());
+        // session isn't required when using http basic authentification mecanism for example
+        if ($request->hasSession()) {
+            $request->getSession()->set('_security.target_path', $request->getUri());
+        }
 
         return $this->authenticationEntryPoint->start($event, $request, $authException);
     }