开发者

Can't set a cookie in Chrome 5

开发者 https://www.devze.com 2023-01-01 19:34 出处:网络
Since today I开发者_开发技巧 am facing a tricky issue with Google Chrome that I\'ve just updated to v5.

Since today I开发者_开发技巧 am facing a tricky issue with Google Chrome that I've just updated to v5.

I have a user login process running on my website. Everything works fine on FF 3.6.x and IE 7, but I just can't set any cookie in Google Chrome 5. I'm mentioning 5 because it worked very well before on v4.

My PHP script looks like that:

  $cook = setcookie($cookieName, $value, $expires, '/', '.'.$domain);
  var_dump($cook, isset($_COOKIE[$cookieName]));

I even tried the alternative setrawcookie without any result.

  $cook = setrawcookie($cookieName, $value, $expires, '/', '.'.$domain);
  var_dump($cook, isset($_COOKIE[$cookieName]));

FF 3.6.x and IE7 output:

bool(true) bool(true)

Whereas Chrome v5 outputs:

bool(true) bool(false)

And obviously I see not trace of this cookie in Google Chrome 5. Any idea? =/

Cheers,

Nicolas.


You can check cookies by entering javascript:alert(document.cookie) into address bar.

Cookie will be sent to server on 2nd request. [browser request(no cookie)]->[server response(set cookie)]...[browser request(cookie, if valid)]->... So you should see the cookie in $_COOKIE by refreshing the testpage.

Also check if your parameters are right. (time in future and domain is your domain)


I've the same , check your system date and time

0

精彩评论

暂无评论...
验证码 换一张
取 消