WpOrg\Requests\Cookie
Jar::before_redirect_check
Parse all cookies from a response and attach them to the response
Method of the class: Jar{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Jar = new Jar(); $Jar->before_redirect_check( $response );
- $response(WpOrg\Requests\Response) (required)
- Response as received.
Jar::before_redirect_check() Jar::before redirect check code WP 7.0
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;
}