Uses
Uses | Description |
---|---|
wp-includes/Requests/Cookie.php: Requests_Cookie::format_for_header() | Format a cookie for a Cookie header |
Format a cookie for a Set-Cookie header
This is used when sending cookies to clients. This isn’t really applicable to client-side usage, but might be handy for debugging.
(string) Cookie formatted for Set-Cookie header
File: wp-includes/Requests/Cookie.php
public function format_for_set_cookie() { $header_value = $this->format_for_header(); if (!empty($this->attributes)) { $parts = array(); foreach ($this->attributes as $key => $value) { // Ignore non-associative attributes if (is_numeric($key)) { $parts[] = $value; } else { $parts[] = sprintf('%s=%s', $key, $value); } } $header_value .= '; ' . implode('; ', $parts); } return $header_value; }
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/requests_cookie/format_for_set_cookie