protected function addCookieOption($name, $value)
    {
        if (is_string($value)) {
            $value = preg_replace("~^;? ?$name=~", '', trim($value));
            if ($value !== '') {
                $this->addOption('cookie', $name, $value);
            }
        }
    }