Skip to content

expires, max-age下这段文字语义不当 #1213

Open
@Lxandcsy

Description

@Lxandcsy
默认情况下,如果一个 cookie 没有设置这两个参数中的任何一个,那么在关闭浏览器之后,它就会消失。此类 cookie 被称为 "session cookie”。

为了让 cookie 在浏览器关闭后仍然存在,我们可以设置 expires 或 max-age 选项中的一个。

没有设置这两个参数中的任何一个关闭浏览器后就会消失,也就是说两个参数必须都设置才不会消失,但是下一段又说设置一个就会存在在,所以这段话有异议

Activity

songhn233

songhn233 commented on Jul 26, 2024

@songhn233
Member

我理解是这句话存在歧义,原来的意思也是表示两个参数如果都没有设置的话,关闭浏览器会消失。

这里翻译可以修改一下,为「默认情况下,如果一个 cookie 这两个参数都没有设置,那么在关闭浏览器之后,它就会消失。」应该就没有歧义了

Lxandcsy

Lxandcsy commented on Aug 26, 2024

@Lxandcsy
Author

是的大神!感谢回复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      expires, max-age下这段文字语义不当 · Issue #1213 · javascript-tutorial/zh.javascript.info