Cookie::uri_matches( WpOrgRequestsIri $uri ): boolean

In this article

Check if a cookie is valid for a given URI

Parameters

$uriWpOrgRequestsIrirequired
URI to check

Return

boolean Whether the cookie is valid for the given URI

Source

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

User Contributed Notes

You must log in before being able to contribute a note or feedback.