public function add(Cookie $cookie)
    {
        if ($cookie instanceof MutableCookie) {
            $this->cookies[$cookie->getName()] = $cookie;
        } elseif ($cookie instanceof ResponseCookie) {
            $this[$cookie->getName()]->set($cookie->get())
                ->setPath($cookie->getPath())
                ->setDomain($cookie->getDomain())
                ->setSecure($cookie->isSecure())
                ->setHttpOnly($cookie->isHttpOnly())
                ->expiresAt($cookie->getExpiration());
        } else {
            $this->cookies[$cookie->getName()] = $this->setDefaults(
                new MutableCookie($cookie->getName(), $cookie->get())
            );
        }
    }