]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/front/controller/admin/LogoutController.php
Update French translation
[github/shaarli/Shaarli.git] / application / front / controller / admin / LogoutController.php
index 41e81984a4c89ef6407e3e0c3463dfe0e649a473..28165129f5596cc8aaf7b04da36e6271145bb7d7 100644 (file)
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Shaarli\Front\Controller\Admin;
 
+use Shaarli\Security\CookieManager;
 use Shaarli\Security\LoginManager;
 use Slim\Http\Request;
 use Slim\Http\Response;
@@ -20,10 +21,13 @@ class LogoutController extends ShaarliAdminController
     {
         $this->container->pageCacheManager->invalidateCaches();
         $this->container->sessionManager->logout();
+        $this->container->cookieManager->setCookieParameter(
+            CookieManager::STAY_SIGNED_IN,
+            'false',
+            0,
+            $this->container->basePath . '/'
+        );
 
-        // TODO: switch to a simple Cookie manager allowing to check the session, and create mocks.
-        setcookie(LoginManager::$STAY_SIGNED_IN_COOKIE, 'false', 0, $this->container->webPath);
-
-        return $response->withRedirect('./');
+        return $this->redirect($response, '/');
     }
 }