1

I'm retrieving some cookies information and some of them have the expires property set to -1, does anyone knows what this means?

4

1 回答 1

3

http://webpy.org/cookbook/cookies

任何负数都会立即使 cookie 过期。任何正数都是 cookie 将持续的秒数(3600 将导致一个小时长的 cookie)

虽然值得检查 cookie 是否有一max-age

https://mrcoles.com/blog/cookies-max-age-vs-expires/

每个支持 max-age 的浏览器都会忽略 expires 而不管它的值,同样,Internet Explorer 会忽略 max-age 而只使用 expires

于 2018-06-04T13:13:18.787 回答