if (\PHP_SESSION_ACTIVE === session_status()) { throw new \RuntimeException('Failed to start the session: already started by PHP.'); } if (ini_get('session.use_cookies') && headers_sent($file, $line)) { throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line)); } // ok to try and start the session if (!session_start()) { throw new \RuntimeException('Failed to start the session'); * @param string $providerKey The name of your firewall * @param string $uri The URI to set as the target path */ private function saveTargetPath(SessionInterface $session, $providerKey, $uri) { $session->set('_security.'.$providerKey.'.target_path', $uri); } /** * Returns the URL (if any) the user visited that forced them to login. * protected function setTargetPath(Request $request) { // session isn't required when using HTTP basic authentication mechanism for example if ($request->hasSession() && $request->isMethodSafe(false) && !$request->isXmlHttpRequest()) { $this->saveTargetPath($request->getSession(), $this->providerKey, $request->getUri()); } }}
if (null !== $this->logger) { $this->logger->debug('Calling Authentication entry point.'); } if (!$this->stateless) { $this->setTargetPath($request); } if ($authException instanceof AccountStatusException) { // remove the security token to prevent infinite redirect loops $this->tokenStorage->setToken(null); try { $insufficientAuthenticationException = new InsufficientAuthenticationException('Full authentication is required to access this resource.', 0, $exception); $insufficientAuthenticationException->setToken($token); $event->setResponse($this->startAuthentication($event->getRequest(), $insufficientAuthenticationException)); } catch (\Exception $e) { $event->setException($e); } return; $exception = $event->getException(); do { if ($exception instanceof AuthenticationException) { return $this->handleAuthenticationException($event, $exception); } elseif ($exception instanceof AccessDeniedException) { return $this->handleAccessDeniedException($event, $exception); } elseif ($exception instanceof LogoutException) { return $this->handleLogoutException($exception); } } while (null !== $exception = $exception->getPrevious()); } * @throws \Exception */ private function handleException(\Exception $e, $request, $type) { $event = new GetResponseForExceptionEvent($this, $request, $type, $e); $this->dispatcher->dispatch(KernelEvents::EXCEPTION, $event); // a listener might have replaced the exception $e = $event->getException(); if (!$event->hasResponse()) {//$kernel = new AppCache($kernel);// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter//Request::enableHttpMethodParameterOverride();$request = Request::createFromGlobals();$response = $kernel->handle($request);$response->send();$kernel->terminate($request, $response);
No log messages
RuntimeException |
|---|
RuntimeException:Failed to start the session because headers have already been sent by "/home/uqipvwpi/public_html/skyvision/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php" at line 2636.at vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php:141atSymfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
(vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php:302)atSymfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->getBag('attributes')
(vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Session.php:249)atSymfony\Component\HttpFoundation\Session\Session->getBag('attributes')
(vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Session.php:271)atSymfony\Component\HttpFoundation\Session\Session->getAttributeBag()
(vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Session.php:81)atSymfony\Component\HttpFoundation\Session\Session->set('_security.main.target_path', 'https://www.skyvision.alex-ivanov.eu/')
(vendor/symfony/symfony/src/Symfony/Component/Security/Http/Util/TargetPathTrait.php:32)atSymfony\Component\Security\Http\Firewall\ExceptionListener->saveTargetPath(object(Session), 'main', 'https://www.skyvision.alex-ivanov.eu/')
(vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php:214)atSymfony\Component\Security\Http\Firewall\ExceptionListener->setTargetPath(object(Request))
(vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php:187)atSymfony\Component\Security\Http\Firewall\ExceptionListener->startAuthentication(object(Request), object(InsufficientAuthenticationException))
(vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php:129)atSymfony\Component\Security\Http\Firewall\ExceptionListener->handleAccessDeniedException(object(GetResponseForExceptionEvent), object(AccessDeniedException))
(vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php:94)atSymfony\Component\Security\Http\Firewall\ExceptionListener->onKernelException(object(GetResponseForExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher))atcall_user_func(array(object(ExceptionListener), 'onKernelException'), object(GetResponseForExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher))
(vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php:104)atSymfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(GetResponseForExceptionEvent), 'kernel.exception', object(ContainerAwareEventDispatcher))
(vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:212)atSymfony\Component\EventDispatcher\EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.exception', object(GetResponseForExceptionEvent))
(vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:44)atSymfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.exception', object(GetResponseForExceptionEvent))
(vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php:139)atSymfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch('kernel.exception', object(GetResponseForExceptionEvent))
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:228)atSymfony\Component\HttpKernel\HttpKernel->handleException(object(AccessDeniedException), object(Request), 1)
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:79)atSymfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:202)atSymfony\Component\HttpKernel\Kernel->handle(object(Request))
(web/app.php:19)
|