public function add($cookie): self
    {
        if ($cookie instanceof Cookie || $cookie instanceof SetCookie) {
            $clone                              = clone $this;
            $clone->cookies[$cookie->getName()] = $cookie;

            return $clone;
        }

        throw new InvalidArgumentException(\sprintf(
            'The object [%s] must be an instance of [%s] or [%s].',
            \get_class($cookie),
            Cookie::class,
            SetCookie::class
        ));
    }