我正在尝试在 setcookie 中为我的网站 cookie 设置路径,其中包含一个字符串,后跟 #wall ,我只能看到路径直到第一个字符串,它不接受路径的 # 部分。
代码是这样的:
$wall = array(
$this->database,
$this->response['grouplist'][0],
$this->username
);
setcookie(
"wall",
json_encode($wall),
time() + 3600 * 24 * 1000 ,
"/" + $this->database + "/#wall",
".mywebsite.com",
0
);
session_set_cookie_params(0, '/', '.mywebsite.com');
输出 :
mywebsite.com /S71c9524b57ab1b3383bcb14478b570b6 2019-07-16T06:37:55.065Z 92