/** * Check Cookies and get authorized user if he exists */ function User_getUserFromCookie() { if (array_key_exists('sid', $_COOKIE) && array_key_exists('login', $_COOKIE)) { $user = User_isUserLogged($_COOKIE['login'], $_COOKIE['sid']); if (!empty($user)) { return $user; } } User_logout(); return null; }
function AjaxController_logout() { User_logout(); AjaxController_sendResponse(0, 'user_logout'); }