public function set($name, $value, $deleteCookie = false)
    {
        $attributeValueList = [];

        if ($this->cookieOptions['Secure']) {
            $attributeValueList[] = 'Secure';
        }
        if ($this->cookieOptions['HttpOnly']) {
            $attributeValueList[] = 'HttpOnly';
        }

        if (null !== $this->cookieOptions['Path']) {
            $attributeValueList[] = \sprintf('Path=%s', $this->cookieOptions['Path']);
        }
        if (null !== $this->cookieOptions['Domain']) {
            $attributeValueList[] = \sprintf('Domain=%s', $this->cookieOptions['Domain']);
        }

        if (null !== $this->cookieOptions['Max-Age'] && !$deleteCookie) {
            $attributeValueList[] = \sprintf('Max-Age=%d', $this->cookieOptions['Max-Age']);
        }

        if ($deleteCookie) {
            // Max-Age=0 is a special value indicating to the browser that the
            // cookie has to be deleted...
            $attributeValueList[] = 'Max-Age=0';
        }

        if (null !== $this->cookieOptions['SameSite']) {
            $attributeValueList[] = \sprintf('SameSite=%s', $this->cookieOptions['SameSite']);
        }

        $this->header->set(
            \sprintf(
                'Set-Cookie: %s=%s; %s',
                $name,
                $value,
                \implode('; ', $attributeValueList)
            ),
            false // do not replace
        );
    }