if (\PHP_SESSION_ACTIVE === session_status()) { throw new \RuntimeException('Failed to start the session: already started by PHP.'); } if (filter_var(\ini_get('session.use_cookies'), \FILTER_VALIDATE_BOOL) && 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)); } $sessionId = $_COOKIE[session_name()] ?? null; /* * Explanation of the session ID regular expression: `/^[a-zA-Z0-9,-]{22,250}$/`. } if (!$this->started && $this->saveHandler->isActive()) { $this->loadSession(); } elseif (!$this->started) { $this->start(); } return $this->bags[$name]; } $this->storage->registerBag(new SessionBagProxy($bag, $this->data, $this->usageIndex, $this->usageReporter)); } public function getBag(string $name): SessionBagInterface { $bag = $this->storage->getBag($name); return method_exists($bag, 'getBag') ? $bag->getBag() : $bag; } /** * * Note that this method was added to help with IDE autocompletion. */ private function getAttributeBag(): AttributeBagInterface { return $this->getBag($this->attributeName); }} return $this->storage->start(); } public function has(string $name): bool { return $this->getAttributeBag()->has($name); } public function get(string $name, mixed $default = null): mixed { return $this->getAttributeBag()->get($name, $default); $request = $this->getRequest(); $authenticationException = null; if ($request->attributes->has(SecurityRequestAttributes::AUTHENTICATION_ERROR)) { $authenticationException = $request->attributes->get(SecurityRequestAttributes::AUTHENTICATION_ERROR); } elseif ($request->hasSession() && ($session = $request->getSession())->has(SecurityRequestAttributes::AUTHENTICATION_ERROR)) { $authenticationException = $session->get(SecurityRequestAttributes::AUTHENTICATION_ERROR); if ($clearSession) { $session->remove(SecurityRequestAttributes::AUTHENTICATION_ERROR); } // if ($this->getUser()) { // return $this->redirectToRoute('target_path'); // } // get the login error if there is one $error = $authenticationUtils->getLastAuthenticationError(); // last username entered by the user $lastUsername = $authenticationUtils->getLastUsername(); return $this->render('security/login.html.twig', ['last_username' => $lastUsername, 'error' => $error]); } $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS); $controller = $event->getController(); $arguments = $event->getArguments(); // call controller $response = $controller(...$arguments); // view if (!$response instanceof Response) { $event = new ViewEvent($this, $request, $type, $response, $event); $this->dispatcher->dispatch($event, KernelEvents::VIEW); $request->headers->set('X-Php-Ob-Level', (string) ob_get_level()); $this->requestStack->push($request); $response = null; try { return $response = $this->handleRaw($request, $type); } catch (\Throwable $e) { if ($e instanceof \Error && !$this->handleAllThrowables) { throw $e; } $this->boot(); ++$this->requestStackSize; $this->resetServices = true; try { return $this->getHttpKernel()->handle($request, $type, $catch); } finally { --$this->requestStackSize; } } $this->request = $request; } public function run(): int { $response = $this->kernel->handle($this->request); $response->send(); if ($this->kernel instanceof TerminableInterface) { $this->kernel->terminate($this->request, $response); }$app = $app(...$args);exit( $runtime ->getRunner($app) ->run());<?phpuse App\Kernel;require_once dirname(__DIR__).'/vendor/autoload_runtime.php';return function (array $context) { return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);};No log messages
|
RuntimeException
|
|---|
RuntimeException:
Failed to start the session because headers have already been sent by "/home/u262228329/domains/edenolam.com/public_html/freereads/vendor/symfony/cache/Adapter/FilesystemAdapter.php" at line 23.
at vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:132
at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
(vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:311)
at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->getBag()
(vendor/symfony/http-foundation/Session/Session.php:222)
at Symfony\Component\HttpFoundation\Session\Session->getBag()
(vendor/symfony/http-foundation/Session/Session.php:242)
at Symfony\Component\HttpFoundation\Session\Session->getAttributeBag()
(vendor/symfony/http-foundation/Session/Session.php:64)
at Symfony\Component\HttpFoundation\Session\Session->has()
(vendor/symfony/security-http/Authentication/AuthenticationUtils.php:40)
at Symfony\Component\Security\Http\Authentication\AuthenticationUtils->getLastAuthenticationError()
(src/Controller/SecurityController.php:20)
at App\Controller\SecurityController->login()
(vendor/symfony/http-kernel/HttpKernel.php:181)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
(vendor/symfony/http-kernel/HttpKernel.php:76)
at Symfony\Component\HttpKernel\HttpKernel->handle()
(vendor/symfony/http-kernel/Kernel.php:197)
at Symfony\Component\HttpKernel\Kernel->handle()
(vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
(vendor/autoload_runtime.php:29)
at require_once('/home/u262228329/domains/edenolam.com/public_html/freereads/vendor/autoload_runtime.php')
(public/index.php:5)
|