updating cookie code