开发者

Facebook SDK PHP doesn't work in Google-Chrome?

开发者 https://www.devze.com 2023-04-06 03:50 出处:网络
Ok so I downloaded the latest copy of Facebook\'s PHP SDK from Github, uploaded it to a test web server and ran the example that it comes with the SDK. Run the example with Google-Chrome (the latest v

Ok so I downloaded the latest copy of Facebook's PHP SDK from Github, uploaded it to a test web server and ran the example that it comes with the SDK. Run the example with Google-Chrome (the latest version, and NO widget installed) and it takes me through the Facebook process but on the redirection of a successful login/connect it comes up that my session only has a single variable "state", and says I'm still not connected. I look in my installed applications on Facebook and it is definitely installed.

At first I thought there was something wrong with my session or maybe the browser, so I tried the same process in Safari, FireFox, Opera and even Internet Explorer 7. ALL WORKED PERFECTLY!!

Is there a known issue with Google-Chrome?

As for any code, I didn't change a single thing, whatever is in the latest branch of the Facebook SDK PHP Github is what I used.

Any ideas or is anyone else experiencing the same problems with Google-Chrome, its really frustrating because Google-Chrome would be my preferred browser and it means that I'm going to have to test my Facebook application on a different browser and开发者_开发技巧 if it goes public users of Google-Chrome aren't going to experience my application at all.


Check your Chrome configuration in Options->Under the hood->Content settings->Cookies and make sure the "Block all third-party cookies without exception" box is unchecked.


I beileve I was having a similar problem with IE6, place this on the very top line of the facebook.php file:

header('P3P: CP="CAO PSA OUR"');

That may solve the problem.


Edit (adlawson)

Due to a lack of explanation of P3P header, I'll add a little more.

  • The header was suggested by Facebook as a fix for apps in an iFrame run on IE6, as described here
  • The P3P header is used to simply declare the information the site uses from the client, as described on wikipedia

This answer does not solve the issue in Chrome, but may be useful for problems in IE6


header('P3P: CP="CAO PSA OUR"');

^^ Resolved my Chrome issue.

0

精彩评论

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