diff --git a/src/Session/SessionMiddleware.php b/src/Session/SessionMiddleware.php index 20e997f..3bdbf86 100644 --- a/src/Session/SessionMiddleware.php +++ b/src/Session/SessionMiddleware.php @@ -36,7 +36,10 @@ public function __construct(SessionInterface $session) */ public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next): ResponseInterface { - $this->session->start(); + if (!$this->session->isStarted()) { + $this->session->start(); + } + $response = $next($request, $response); $this->session->save();