Facebook app iframe login issue on safari

I have a facebook application that uses iframe.

facebook loads my site inside an iframe. When I click the link, an iframe is displayed on my website, using the lightbox to display the facebook login. Everything works fine on ff, i.e. Chromium. On safari, the frame continues to reboot endlessly.

Php code

$me = null; $session = $facebook->getSession(); if ($session) { try { $me = $facebook->api('/me'); $_SESSION['facebook'] = $me; } catch (FacebookApiException $e) { } } if($me) require_once("logged.php"); else require_once("login.php"); 

javascript in login.php

 window.fbAsyncInit = function() { FB.init({ appId : '<?=$appId?>', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); check_login_session(); // whenever the user logs in, we refresh the page FB.Event.subscribe('auth.login', function() { $.browser.safari = ( $.browser.safari && /chrome/.test(navigator.userAgent.toLowerCase()) ) ? false : true; window.location.href = window.location.href; }); }; 

Any ideas would be appreciated!

Thanks!

+4
source share
1 answer

If you are still looking for a solution, try creating P3P headers http://www.p3pwriter.com/LRN_121.asp

usually there is a security problem when setting cookies inside an iframe, p3p headers act as an agreement between the website and the client computer, ensuring that the information stored in the cookies is not used incorrectly.

quick fix: http://planet.admon.org/how-to-implement-p3p-http-headers-for-cross-site-cookies/

what to do: copy this into your header:

 <?php header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"') ?> 

here it is!

+2
source

All Articles