WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

YoastSEO_Vendor\GuzzleHttp\Cookie

CookieJar::setCookie() public Yoast 1.0

{} Это метод класса: CookieJar{}

Хуков нет.

Возвращает

Null. Ничего.

Использование

$CookieJar = new CookieJar();
$CookieJar->setCookie( \YoastSEO_Vendor\GuzzleHttp\Cookie\SetCookie $cookie );

Код CookieJar::setCookie() Yoast 15.6.2

<?php
public function setCookie(\YoastSEO_Vendor\GuzzleHttp\Cookie\SetCookie $cookie)
{
    // If the name string is empty (but not 0), ignore the set-cookie
    // string entirely.
    $name = $cookie->getName();
    if (!$name && $name !== '0') {
        return \false;
    }
    // Only allow cookies with set and valid domain, name, value
    $result = $cookie->validate();
    if ($result !== \true) {
        if ($this->strictMode) {
            throw new \RuntimeException('Invalid cookie: ' . $result);
        } else {
            $this->removeCookieIfEmpty($cookie);
            return \false;
        }
    }
    // Resolve conflicts with previously set cookies
    foreach ($this->cookies as $i => $c) {
        // Two cookies are identical, when their path, and domain are
        // identical.
        if ($c->getPath() != $cookie->getPath() || $c->getDomain() != $cookie->getDomain() || $c->getName() != $cookie->getName()) {
            continue;
        }
        // The previously set cookie is a discard cookie and this one is
        // not so allow the new cookie to be set
        if (!$cookie->getDiscard() && $c->getDiscard()) {
            unset($this->cookies[$i]);
            continue;
        }
        // If the new cookie's expiration is further into the future, then
        // replace the old cookie
        if ($cookie->getExpires() > $c->getExpires()) {
            unset($this->cookies[$i]);
            continue;
        }
        // If the value has changed, we better change it
        if ($cookie->getValue() !== $c->getValue()) {
            unset($this->cookies[$i]);
            continue;
        }
        // The cookie exists, so no need to continue
        return \false;
    }
    $this->cookies[] = $cookie;
    return \true;
}