Requests_Cookie::uri_matches()publicWP 1.0

Check if a cookie is valid for a given URI

{} It's a method of the class: Requests_Cookie{}

No Hooks.


true|false. Whether the cookie is valid for the given URI


$Requests_Cookie = new Requests_Cookie();
$Requests_Cookie->uri_matches( $uri );
$uri(Requests_IRI) (required)
URI to check

Code of Requests_Cookie::uri_matches() WP 6.0

public function uri_matches(Requests_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';