Skip to content

Commit 9b6ff05

Browse files
alamiraultfabpot
authored andcommitted
Remove usage of empty function when possible
1 parent eb18c02 commit 9b6ff05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

EventListener/AbstractSessionListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function onKernelResponse(ResponseEvent $event)
151151
$request = $event->getRequest();
152152
$requestSessionCookieId = $request->cookies->get($sessionName);
153153

154-
$isSessionEmpty = ($session instanceof Session ? $session->isEmpty() : empty($session->all())) && empty($_SESSION); // checking $_SESSION to keep compatibility with native sessions
154+
$isSessionEmpty = ($session instanceof Session ? $session->isEmpty() : !$session->all()) && empty($_SESSION); // checking $_SESSION to keep compatibility with native sessions
155155
if ($requestSessionCookieId && $isSessionEmpty) {
156156
// PHP internally sets the session cookie value to "deleted" when setcookie() is called with empty string $value argument
157157
// which happens in \Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler::destroy

0 commit comments

Comments
 (0)