// 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;
} // If we didn't die until now, return true.
return true;
} /**
* Get the cookie as a string, suitable for sending as a "Cookie" header in an
* HTTP request
*
* @return string
*/