WpOrg\Requests
Cookie::uri_matches
Check if a cookie is valid for a given URI
Method of the class: Cookie{}
No Hooks.
Returns
true|false. Whether the cookie is valid for the given URI
Usage
$Cookie = new Cookie(); $Cookie->uri_matches( $uri );
- $uri(WpOrg\Requests\Iri) (required)
- URI to check.
Cookie::uri_matches() Cookie::uri matches code WP 7.0
public function uri_matches(Iri $uri) {
if (!$this->domain_matches($uri->host)) {
return false;
}
if (!$this->path_matches($uri->path)) {
return false;
}
return empty($this->attributes['secure']) || $uri->scheme === 'https';
}