WordPress at Your Fingertips

wp_remote_retrieve_cookies() WP 1.0

Retrieve only the cookies from the raw response.

No Hooks.


WP_Http_Cookie[]. An array of WP_Http_Cookie objects from the response. Empty array if there are none, or the response is a WP_Error.


wp_remote_retrieve_cookies( $response );
$response(array|WP_Error) (required)
HTTP response.


Since 4.4.0 Introduced.

Code of wp_remote_retrieve_cookies() WP 5.8

function wp_remote_retrieve_cookies( $response ) {
	if ( is_wp_error( $response ) || empty( $response['cookies'] ) ) {
		return array();

	return $response['cookies'];

From tag: HTTP API (curl remote)

No comments
    Log In