PHP即时cookie有效期时间怎么设置?

2025-04-15 15:02:36
推荐回答(1个)
回答1:

回"问题补充"

PHP手册上关于setcookie函数的expire参数有这样一个解释
If set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes).
如果设为0 或者忽略该参数, cookie将在session结束时(关闭浏览器时)过期

所以, 如果要写4,5个参数, 那把第三个设为0就可以了