refactored access.php/isUserLogged()