Symfony Exception

TypeError

HTTP 500 Internal Server Error

Argument 1 passed to Illuminate\Session\Middleware\StartSession::addCookieToResponse() must be an instance of Symfony\Component\HttpFoundation\Response, null given, called in /home/storage/e/c0/e9/gki/public_html/_core/vendor/illuminate/session/Middleware/StartSession.php on line 125

Exception

TypeError

  1.      *
  2.      * @param  \Symfony\Component\HttpFoundation\Response  $response
  3.      * @param  \Illuminate\Contracts\Session\Session  $session
  4.      * @return void
  5.      */
  6.     protected function addCookieToResponse(Response $responseSession $session)
  7.     {
  8.         if ($this->sessionIsPersistent($config $this->manager->getSessionConfig())) {
  9.             $response->headers->setCookie(new Cookie(
  10.                 $session->getName(), $session->getId(), $this->getCookieExpirationDate(),
  11.                 $config['path'], $config['domain'], $config['secure'] ?? false,
  1.         $response $next($request);
  2.         $this->storeCurrentUrl($request$session);
  3.         $this->addCookieToResponse($response$session);
  4.         // Again, if the session has been configured we will need to close out the session
  5.         // so that the attributes may be persisted to some storage medium. We will also
  6.         // add the session identifier cookie to the application response headers now.
  7.         $this->saveSession($request);
  1.         if ($this->manager->shouldBlock() ||
  2.             ($request->route() instanceof Route && $request->route()->locksFor())) {
  3.             return $this->handleRequestWhileBlocking($request$session$next);
  4.         }
  5.         return $this->handleStatefulRequest($request$session$next);
  6.     }
  7.     /**
  8.      * Handle the given request within session state.
  9.      *
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
  1.      * @param  \Closure  $next
  2.      * @return mixed
  3.      */
  4.     public function handle($requestClosure $next)
  5.     {
  6.         $response $next($request);
  7.         foreach ($this->cookies->getQueuedCookies() as $cookie) {
  8.             $response->headers->setCookie($cookie);
  9.         }
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
  1.      * @param  \Closure  $next
  2.      * @return \Symfony\Component\HttpFoundation\Response
  3.      */
  4.     public function handle($requestClosure $next)
  5.     {
  6.         return $this->encrypt($next($this->decrypt($request)));
  7.     }
  8.     /**
  9.      * Decrypt the cookies on the request.
  10.      *
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
  1.     {
  2.         $pipeline array_reduce(
  3.             array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
  4.         );
  5.         return $pipeline($this->passable);
  6.     }
  7.     /**
  8.      * Run the pipeline and return the result.
  9.      *
  1.     {
  2.         if (count($middleware) > && ! $this->shouldSkipMiddleware()) {
  3.             return (new Pipeline($this))
  4.                 ->send($this->make('request'))
  5.                 ->through($middleware)
  6.                 ->then($then);
  7.         }
  8.         return $then($this->make('request'));
  9.     }
  1.                 }
  2.                 return $this->handleDispatcherResponse(
  3.                     $this->createDispatcher()->dispatch($method$pathInfo)
  4.                 );
  5.             });
  6.         } catch (Throwable $e) {
  7.             return $this->prepareResponse($this->sendExceptionToHandler($e));
  8.         }
  9.     }
  1.      * @param  \Symfony\Component\HttpFoundation\Request|null  $request
  2.      * @return void
  3.      */
  4.     public function run($request null)
  5.     {
  6.         $response $this->dispatch($request);
  7.         if ($response instanceof SymfonyResponse) {
  8.             $response->send();
  9.         } else {
  10.             echo (string) $response;
  1. | the client's browser allowing them to enjoy the creative
  2. | and wonderful application we have prepared for them.
  3. |
  4. */
  5. $app->run();

Stack Trace

TypeError
TypeError:
Argument 1 passed to Illuminate\Session\Middleware\StartSession::addCookieToResponse() must be an instance of Symfony\Component\HttpFoundation\Response, null given, called in /home/storage/e/c0/e9/gki/public_html/_core/vendor/illuminate/session/Middleware/StartSession.php on line 125

  at /home/storage/e/c0/e9/gki/public_html/_core/vendor/illuminate/session/Middleware/StartSession.php:217
  at Illuminate\Session\Middleware\StartSession->addCookieToResponse(null, object(Store))
     (/home/storage/e/c0/e9/gki/public_html/_core/vendor/illuminate/session/Middleware/StartSession.php:125)
  at Illuminate\Session\Middleware\StartSession->handleStatefulRequest(object(Request), object(Store), object(Closure))
     (/home/storage/e/c0/e9/gki/public_html/_core/vendor/illuminate/session/Middleware/StartSession.php:64)
  at Illuminate\Session\Middleware\StartSession->handle(object(Request), object(Closure))
     (/home/storage/e/c0/e9/gki/public_html/_core/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/home/storage/e/c0/e9/gki/public_html/_core/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
     (/home/storage/e/c0/e9/gki/public_html/_core/vendor/illuminate/cookie/Middleware/AddQueuedCookiesToResponse.php:37)
  at Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
     (/home/storage/e/c0/e9/gki/public_html/_core/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/home/storage/e/c0/e9/gki/public_html/_core/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
     (/home/storage/e/c0/e9/gki/public_html/_core/vendor/illuminate/cookie/Middleware/EncryptCookies.php:67)
  at Illuminate\Cookie\Middleware\EncryptCookies->handle(object(Request), object(Closure))
     (/home/storage/e/c0/e9/gki/public_html/_core/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request))
     (/home/storage/e/c0/e9/gki/public_html/_core/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
     (/home/storage/e/c0/e9/gki/public_html/_core/vendor/illuminate/pipeline/Pipeline.php:103)
  at Illuminate\Pipeline\Pipeline->then(object(Closure))
     (/home/storage/e/c0/e9/gki/public_html/_core/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:426)
  at Laravel\Lumen\Application->sendThroughPipeline(array('Illuminate\\Cookie\\Middleware\\EncryptCookies', 'Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse', 'Illuminate\\Session\\Middleware\\StartSession', 'Illuminate\\View\\Middleware\\ShareErrorsFromSession', 'App\\Http\\Middleware\\HeaderMiddleware'), object(Closure))
     (/home/storage/e/c0/e9/gki/public_html/_core/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:175)
  at Laravel\Lumen\Application->dispatch(null)
     (/home/storage/e/c0/e9/gki/public_html/_core/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112)
  at Laravel\Lumen\Application->run()
     (/home/storage/e/c0/e9/gki/public_html/index.php:30)