From 404739634d3a16389294d1ec8c3942faf1a04986 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 18 Sep 2017 16:08:32 +0200 Subject: [PATCH] Compose 'logout' using new 'logOutButKeepSession' and 'destroySession' --- src/Auth.php | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/Auth.php b/src/Auth.php index b3066da..89e4cc2 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -488,25 +488,8 @@ final class Auth extends UserManager { * @throws AuthError if an internal problem occurred (do *not* catch) */ public function logout() { - // if the user has been signed in - if ($this->isLoggedIn()) { - // get the user's ID - $userId = $this->getUserId(); - // if a user ID was set - if (isset($userId)) { - // delete any existing remember directives - $this->deleteRememberDirective($userId); - } - } - - // unset the session variables - $_SESSION = array(); - - // delete the cookie - $this->deleteSessionCookie(); - - // destroy the session - session_destroy(); + $this->logOutButKeepSession(); + $this->destroySession(); } /**