setrawcookie
(PHP 5, PHP 7, PHP 8)
setrawcookie — 发送未经 URL 编码的 cookie
说明
setrawcookie(
string
string
int
string
string
bool
bool
): bool
string
$name,string
$value = ?,int
$expires_or_options = 0,string
$path = ?,string
$domain = ?,bool
$secure = false,bool
$httponly = false): bool
自 PHP 7.3.0 起可用的替代签名(不支持命名参数):
setrawcookie() 和 setcookie() 非常相似,唯一不同之处是发送到浏览器的 cookie 值没有自动经过 URL 编码(urlencode)。
参数
相关参数的信息参见 setcookie() 的文档。
更新日志
| 版本 | 说明 |
|---|---|
| 7.3.0 |
新增替代签名 options 的支持。此签名还支持设置
SameSite cookie 属性。
|