开发者

Facebook connect cookie disappearing at first page change, on Google Chrome v11

开发者 https://www.devze.com 2023-03-01 04:56 出处:网络
I have been developin开发者_运维问答g two websites that rely on Facebook Connect javascript SDK. The facebook sessions of these websites have been working well on many browsers until I switched to Goo

I have been developin开发者_运维问答g two websites that rely on Facebook Connect javascript SDK. The facebook sessions of these websites have been working well on many browsers until I switched to Google Chrome 11... For some reason, it only works in "private" mode now. And a friend (also using a Mac) experienced the same difficulties today.

In order to understand what went wrong, I observed cookies (using the development panel of Google Chome) while logging in and navigating on my websites. When I login with my facebook account, a fbs_ cookie is stored. It is successfully transmitted to the server when requesting a first page. But, as soon as the page is displayed, the cookie disappears, requiring me to login again with facebook connect!

I tried to force this cookie using a set-cookie response header from the server, but it didn't help.

When I use another browser (firefox, safari) or Google Chrome's "private" mode, both websites work well.

Do you have any clue about the reasons and the solution of that problem?

Update: The problem disappeared the following day, without having to do anything... That's weird!


Are you doing FB.Init() on each page?

Take a look here: http://developers.facebook.com/docs/reference/javascript/FB.init/

And ensure that the cookie param is set to true.

FB.init({ appId : 'YOUR APP ID', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML });

0

精彩评论

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