Simplify the validity checks when checking if user is logged in