WordPress at a glance

wp_remote_retrieve_cookie_value() WP 1.0

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

No Hooks.

Return

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

Usage

wp_remote_retrieve_cookie_value( $response, $name );
$response(array) (required)
HTTP response.
$name(string) (required)
The name of the cookie to retrieve.

Code of wp_remote_retrieve_cookie_value: wp-includes/http.php VER 5.0.1

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

Related Functions

From tag: HTTP API (curl remote)

No comments
    Hello, !     Log In . Register