wp_remote_retrieve_cookie_value( array $response, string $name )

Retrieve a single cookie’s value by name from the raw response.


Parameters

$response

(Required) HTTP response.

$name

(Required) The name of the cookie to retrieve.


Return

(string) The value of the cookie. Empty string if the cookie isn't present in the response.


Source

File: wp-includes/http.php

function wp_remote_retrieve_cookie_value( $response, $name ) {
	$cookie = wp_remote_retrieve_cookie( $response, $name );

	if ( ! is_a( $cookie, 'WP_Http_Cookie' ) ) {
		return '';
	}

	return $cookie->value;
}


Changelog

Changelog
Version Description
WP-4.4.0 Introduced.