0plus1
0plus1

Reputation: 4555

Third party cookies and facebook app inside an iframe, getUser fails

I have this problem that is driving me crazy, I hope it will help also anybody that got to my point.

After reading a lot, apparently all the "hacks" of the past (including the p3p headers) do not work anymore on safari after the next update, so I rewrote everything to append a session id inside a GET, all is fine, apart that apparently without third party cookies facebook do not work anymore:

$user = $facebook->getUser();
        var_dump($user);

This returns the expected result with third party cookies activated, while returns int(0) without cookies activated, why?

Is there a workaround for this?

Thank you!

Upvotes: 1

Views: 1184

Answers (1)

Robbie
Robbie

Reputation: 17720

Turn off cookies in the FB.init / new Facebook class, and record the access token instead. (getAccessToken). Pass that to your iFrame and use setAccessToken to set it just after initiating the Facebook class.

Upvotes: 1

Related Questions