Requests_Cookie::uri_matches

Advertisement

Summery Summery

Check if a cookie is valid for a given URI

Syntax Syntax

Requests_Cookie::uri_matches( Requests_IRI $uri )

Parameters Parameters

$uri

(Requests_IRI) (Required) URI to check

Return Return

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

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

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.