Refresh cookie if invalid cookie or invalid user.