gpt4 book ai didi

cookies - 神秘的Cookie过期日期 `1969-12-31T23:59:59.000Z`

转载 作者:行者123 更新时间:2023-12-02 10:46:17 27 4
gpt4 key购买 nike

我正在将 Cookie 过期时间(使用 Express)设置为当前日期。但在 Chrome 中检查后,日期为 1969-12-31T23:59:59.000Z

在 Firefox 中,Cookie 的到期日期值为 session

为什么我的 cookie 被设置为这个日期?我认为这是一个错误,因为 Chrome 仍在发送 cookie,这意味着它实际上没有过期。

最佳答案

Unix time was started at the beginning of 1970, that means that -1 is in 1969. And that is a commonly used value for "unknown" if the expected value is usually positive. And for cookies MaxAge with a negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits.

来源:https://stackoverflow.com/a/51497662/3892213

关于cookies - 神秘的Cookie过期日期 `1969-12-31T23:59:59.000Z`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51333255/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com