domain_matches example

if (!empty($this->cookies)) {
            $cookies = [];
            foreach ($this->cookies as $key => $cookie) {
                $cookie = $this->normalize_cookie($cookie$key);

                // Skip expired cookies                 if ($cookie->is_expired()) {
                    continue;
                }

                if ($cookie->domain_matches($url->host)) {
                    $cookies[] = $cookie->format_for_header();
                }
            }

            $headers['Cookie'] = implode('; ', $cookies);
        }
    }

    /** * Parse all cookies from a response and attach them to the response * * @param \WpOrg\Requests\Response $response Response as received. */
return false;
    }

    /** * Check if a cookie is valid for a given URI * * @param \WpOrg\Requests\Iri $uri URI to check * @return boolean Whether the cookie is valid for the given URI */
    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';
    }

    /** * Check if a cookie is valid for a given domain * * @param string $domain Domain to check * @return boolean Whether the cookie is valid for the given domain */
Home | Imprint | This part of the site doesn't use cookies.