Requests_Cookie::normalize() WordPress Method
The Requests_Cookie::normalize() method is used to normalize a cookie name and value. This is useful when you need to store a cookie with a name that is not a valid cookie name. For example, if you try to store a cookie with the name "foo[bar]", the cookie will be stored as "foo%5Bbar%5D".
Requests_Cookie::normalize() #
Normalize cookie and attributes
Return
(boolean) Whether the cookie was successfully normalized
Source
File: wp-includes/Requests/Cookie.php
public function normalize() { foreach ($this->attributes as $key => $value) { $orig_value = $value; $value = $this->normalize_attribute($key, $value); if ($value === null) { unset($this->attributes[$key]); continue; } if ($value !== $orig_value) { $this->attributes[$key] = $value; } } return true; }
Expand full source codeCollapse full source codeView on TracView on GitHub