Requests_Cookie::uri_matches() WordPress Method

TheRequests_Cookie::uri_matches() method is used to check if a given URI matches the domain and path of a cookie. This can be used to check if a given cookie should be sent to a particular URI.

Requests_Cookie::uri_matches( Requests_IRI $uri ) #

Check if a cookie is valid for a given URI


Parameters

$uri

(Requests_IRI)(Required)URI to check


Top ↑

Return

(boolean) Whether the cookie is valid for the given URI


Top ↑

Source

File: wp-includes/Requests/Cookie.php

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

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.