summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Http/Firewall/ExceptionListener.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/Http/Firewall/ExceptionListener.php b/Http/Firewall/ExceptionListener.php
index 350b029..d8f016e 100644
--- a/Http/Firewall/ExceptionListener.php
+++ b/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);
}