Jar::before_redirect_check( WpOrgRequestsResponse $response )

In this article

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

Parameters

$responseWpOrgRequestsResponserequired
Response as received.

Source

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

User Contributed Notes

You must log in before being able to contribute a note or feedback.