check if a user is logged in