$uri = Zend_Uri_Http::
factory($uri);
} // Make sure we have a valid Zend_Uri_Http object
if (!
($uri->
valid() && ($uri->
getScheme() == 'http' ||
$uri->
getScheme() =='https'
))) { throw new Zend_Http_Exception('Passed URI is not a valid HTTP or HTTPS URI'
);
} // Check that the cookie is secure (if required) and not expired
if ($this->secure &&
$uri->
getScheme() != 'https'
) return false;
if ($this->
isExpired($now)) return false;
if ($this->
isSessionCookie() && !
$matchSessionCookies) return false;
// Check if the domain matches
if (! self::
matchCookieDomain($this->
getDomain(),
$uri->
getHost())) { return false;
} // Check that path matches using prefix match
if (! self::
matchCookiePath($this->
getPath(),
$uri->
getPath())) { return false;
}