public function addCookiesFromResponse($response, $ref_uri)
    {
        if (! $response instanceof Zend_Http_Response) {
            include_once 'Zend/Http/Exception.php';        
            throw new Zend_Http_Exception(
                '$response is expected to be a Response object, ' .
                gettype($response) . ' was passed'
            );
        }

        $cookie_hdrs = $response->getHeader('Set-Cookie');

        if (is_array($cookie_hdrs)) {
            foreach ($cookie_hdrs as $cookie) {
                $this->addCookie($cookie, $ref_uri);
            }
        } elseif (is_string($cookie_hdrs)) {
            $this->addCookie($cookie_hdrs, $ref_uri);
        }
    }