WpOrg\Requests

Cookie::uri_matches()publicWP 1.0

Check if a cookie is valid for a given URI

Method of the class: Cookie{}

No Hooks.

Return

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() code WP 6.6.2

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';
}