javascript - 过期日期为 1969 年的 cookie 是什么意思?

标签 javascript cookies

enter image description here

Cookie 怎么会在 1969 年过期?

这是什么意思?

谢谢

最佳答案

Unix 时间从 1970 年初开始,这意味着 -1 是 1969 年。如果期望值通常为正,那么这是“未知”的常用值。对于 cookie MaxAge 为负值意味着浏览器关闭后 cookie 就会过期:

spec的相关部分:

5.2.2 [..] If delta-seconds is less than or equal to zero (0), let expiry-time be the earliest representable date and time. Otherwise, let the expiry-time be the current date and time plus delta-seconds seconds.

关于javascript - 过期日期为 1969 年的 cookie 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51497459/

相关文章:

javascript - 更改单击事件时按钮的颜色

javascript - Codeigniter - jQuery 数据表 搜索和分页时不会保留复选框中的选中值

c# - 将 session cookie 设置为 HttpOnly

node.js - Express 和 Socket.IO 共享 cookie

firefox - 多个具有相同名称、域和路径的 cookie?

javascript - onreadystatechange 仅触发一次

javascript - jQuery - animationComplete 持续时间

php语法查询

http - Go HTTP 客户端不返回 cookie

php - 此书签如何让您保持登录到此站点?