WpOrg\Requests\Cookie

Jar::before_redirect_check()publicWP 1.0

Parse all cookies from a response and attach them to the response

Метод класса: Jar{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$Jar = new Jar();
$Jar->before_redirect_check( $response );
$response(\WpOrg\Requests\Response) (обязательный)
Response as received.

Код Jar::before_redirect_check() WP 6.6.2

public function before_redirect_check(Response $response) {
	$url = $response->url;
	if (!$url instanceof Iri) {
		$url = new Iri($url);
	}

	$cookies           = Cookie::parse_from_headers($response->headers, $url);
	$this->cookies     = array_merge($this->cookies, $cookies);
	$response->cookies = $this;
}