HTTP/2 301
server: nginx
date: Fri, 10 Oct 2025 20:02:56 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
vary: accept, content-type
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/functions/wp_remote_retrieve_cookie_value/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
HTTP/2 200
server: nginx
date: Fri, 10 Oct 2025 20:02:57 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
wp_remote_retrieve_cookie_value() – Function | Developer.WordPress.org
WordPress Developer Resources
wp_remote_retrieve_cookie_value()
wp_remote_retrieve_cookie_value( array|WP_Error $response, string $name ): string
Retrieves a single cookie’s value by name from the raw response.
$response
array|WP_ErrorrequiredHTTP response.
$name
stringrequiredThe name of the cookie to retrieve.
string The value of the cookie, or empty string if the cookie is not present in the response.
function wp_remote_retrieve_cookie_value( $response, $name ) {
$cookie = wp_remote_retrieve_cookie( $response, $name );
if ( ! ( $cookie instanceof WP_Http_Cookie ) ) {
return '';
}
return $cookie->value;
}
View all references View on Trac View on GitHub
Version | Description |
---|
4.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.