Title: Requests_Cookie::normalize_attribute
Published: August 16, 2016
Last modified: November 2, 2022

---

# Requests_Cookie::normalize_attribute( string $name, string|boolean $value ): mixed

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/requests_cookie/normalize_attribute/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/classes/requests_cookie/normalize_attribute/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/requests_cookie/normalize_attribute/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/requests_cookie/normalize_attribute/?output_format=md#source)

[ Back to top](https://developer.wordpress.org/reference/classes/requests_cookie/normalize_attribute/?output_format=md#wp--skip-link--target)

Parse an individual cookie attribute

## 󠀁[Description](https://developer.wordpress.org/reference/classes/requests_cookie/normalize_attribute/?output_format=md#description)󠁿

Handles parsing individual attributes from the cookie values.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/requests_cookie/normalize_attribute/?output_format=md#parameters)󠁿

 `$name`stringrequired

Attribute name

`$value`string|booleanrequired

Attribute value (string value, or true if empty/flag)

## 󠀁[Return](https://developer.wordpress.org/reference/classes/requests_cookie/normalize_attribute/?output_format=md#return)󠁿

 mixed Value if available, or null if the attribute value is invalid (and should
be skipped)

## 󠀁[Source](https://developer.wordpress.org/reference/classes/requests_cookie/normalize_attribute/?output_format=md#source)󠁿

[View all references](https://developer.wordpress.org/reference/files/wp-includes/requests/cookie.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/Requests/Cookie.php#L254)

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Frequests_cookie%2Fnormalize_attribute%2F)
before being able to contribute a note or feedback.