Requests_Cookie::format_for_set_cookie()
最后更新于:2021-11-26 01:03:29
Requests_Cookie::format_for_set_cookie()Format a cookie for a Set-Cookie header
响应
(string) Cookie formatted for Set-Cookie header
源文件
文件: gc-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;
}