且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么我的cookie没有显示在链接页面上?

更新时间:2023-12-03 08:18:58

86400 很久很久以前.

您的Cookie会立即过期.

Your cookie expires immediately.

请参见文档:

cookie过期的时间.这是Unix时间戳,以秒为单位,以秒为单位.换句话说,您很可能会使用time()函数加上希望它过期之前的秒数来进行设置.或者您可以使用mktime().time()+ 60 * 60 * 24 * 30将cookie设置为在30天后过期.如果设置为0或省略,则cookie将在会话结束时(浏览器关闭时)失效.

The time the cookie expires. This is a Unix timestamp so is in number of seconds since the epoch. In other words, you'll most likely set this with the time() function plus the number of seconds before you want it to expire. Or you might use mktime(). time()+60*60*24*30 will set the cookie to expire in 30 days. If set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes).