douji1853
2011-11-14 03:12
浏览 168
已采纳

Chrome忽略跨域Cookie过期

On domain 1, I have a form that posts to domain 2

<form method="post" action="http://domain2.com/result.php">

The script result.php on domain 2 sets a cookie on domain 2 that is supposed to last until the year 2038.

setcookie('test', 'val', 2147485540, '/', '.domain2.com', false);

The cookie is being stored, but on Chrome, the expiration is set to "When I close my browser" (in other words, 0). On Firefox the expiration is set correctly.

Is there any way around this or is this a Chrome security setting regarding cross-domain posting that I'll just have to live with?

图片转代码服务由CSDN问答提供 功能建议

在域1上,我有一个发布到域2的表单

  &lt; form method =“post”action =“http://domain2.com/result.php”&gt; 
   
 
 

脚本result.php 在域2上设置一个cookie,它应该持续到2038年。

  setcookie('test','val',2147485540,'/','  .domain2.com',false); 
   
 
 

正在存储Cookie,但在Chrome上,过期时间设置为“当我关闭浏览器时”(在 换句话说,0)。 在Firefox上,过期设置正确。

有没有办法解决这个问题,或者这是一个关于跨域发布的Chrome安全设置,我将不得不忍受?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题