[core] Check if the user in session is valid