updated set cookie method