public static function logout() { if (isset($_COOKIE['session_key'])) { $session_key = $_COOKIE['session_key']; SJB_UserManager::removeUserSessionKey($session_key); SJB_Authorization::setKeepCookieForUser($session_key, false); } SJB_Session::unsetValue('userLoginCounter'); SJB_Session::setValue('current_user', null); SJB_Event::dispatch('Logout'); }