Javascript Cookie没有到期日期 [英] Javascript Cookie with no expiration date

查看:116
本文介绍了Javascript Cookie没有到期日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置一个不会过期的Cookie。是否可能?

I would like to set up a cookie that never expires. Would that even be possible?

 document.cookie = "name=value; expires=date; path=path;domain=domain; secure";

我不想让日期太大,我只是想知道是否有值对于cookie的expires参数,告诉它永不过期。

I don't want to make the date really large, I am just wondering if there was a value for the expires parameter on the cookie that told it never to expire.

感谢。

推荐答案

不能做。这样做的方式只是使到期日期为2020年。

Nope. Can't be done. The 'way' of doing that is just making the expiration date be like 2020.

这篇关于Javascript Cookie没有到期日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆