Skip to content

Commit e2689ed

Browse files
authored
Merge pull request #3 from diwms/master
Middleware improvement
2 parents b7d6f8f + 0bd5b63 commit e2689ed

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Session/SessionMiddleware.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ public function __construct(SessionInterface $session)
3636
*/
3737
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next): ResponseInterface
3838
{
39-
$this->session->start();
39+
if (!$this->session->isStarted()) {
40+
$this->session->start();
41+
}
42+
4043
$response = $next($request, $response);
4144
$this->session->save();
4245

0 commit comments

Comments
 (0)