Chrome的Cookie到期日期错误 [英] Error in cookie expiration date for Chrome

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

问题描述

我在Chrome上的cookie到期日期有问题。我使用ColdFusion设置了两个这样的Cookie:

I am having problem with the cookie expiry date on Chrome. I set two cookies like this using ColdFusion:

<cfset thekey = generatesecretkey("DESEDE")>
<cfcookie name="cookie1" value="#Hash(userid&thekey,'SHA-256')#" httponly="true" >
<cfcookie name="cookie2" value="#thekey#" httponly="true" >

他们已经工作了一段时间。但是,在升级到ColdFusion 10并使用Chrome后,奇怪的事情开始发生。这仅发生在Chrome浏览器中。其他浏览器没有此问题:

They have been working for a while. However, after the upgrade to ColdFusion 10 and working with Chrome, weird thing started to happen. It only happened with Chrome browser. Other browsers do not have this issue:

设置了这两个Cookie后,它们都以 1969年12月31日星期三7:00结尾:11 PM

When these two cookies are set they both end up with an expiry date of Wednesday December 31, 1969 at 7:00:11 PM

这让我很困惑。如您所见,我没有设定任何有效期限。因此,默认值为仅会话。它们应该在用户会话结束时过期。我的问题是这个日期从哪里来?是从ColdFusion 10服务器还是Chrome?我不知道为什么这个日期会出现在Chrome的Cookie的 Expires 字段中。在此到期日期之前,cookie被视为已过期,将无法使用。

This puzzled me greatly. I didn't set any expiry date as you can see. So the default is session only. They are supposed to expire at the end of user's session. My question is where is this date come from? Is it from the ColdFusion 10 server or Chrome? I am lost as to why this date is appearing on the cookie's Expires field in Chrome. With this expiry date, the cookies are considered expired already and won't work.

推荐答案

对于会话Cookie,Chrome开发工具仅显示奇怪的有效期限,实际上它没有任何作用。

For session cookies Chrome Dev Tools just show that strange expiration date which actually doesn't play any role.

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

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