Retrieves cookies from the response.
Source
public function get_cookies() {
$cookies = array();
foreach ( $this->response->cookies as $cookie ) {
$cookies[] = new WP_Http_Cookie(
array(
'name' => $cookie->name,
'value' => urldecode( $cookie->value ),
'expires' => $cookie->attributes['expires'] ?? null,
'path' => $cookie->attributes['path'] ?? null,
'domain' => $cookie->attributes['domain'] ?? null,
'host_only' => $cookie->flags['host-only'] ?? null,
)
);
}
return $cookies;
}
Changelog
| Version | Description |
|---|---|
| 4.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.