Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已使用此代码设置 cookie
{ setcookie('username2',$username,time()+60*60*24*365); }
在子文件夹中,它显示 $_cookies['username2'] 中的值,但是当我在 root 上调用它时,它不会打印任何值
将此添加到 setcookie 中,以便整个域都可以使用它。
setcookie('username2',$username,time()+60*60*24*365, '/');
setcookie 手册