Something with “echo $facebook->init();” is causing my site to refresh over and over again in Chrome only. (Edit*: This also happens on my Android phone w/ Dolphin Browser.)
The code that calls this is:
echo $facebook-init();
and it generates this:
<div id="fb-root"></div><script type="text/javascript">
//<![CDATA[
window.fbAsyncInit = function() {
FB.init({
appId : '203899102970207',
session : null, // don't refetch the session when PHP already has it
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// whenever the user logs in, we refresh the page
FB.Event.subscribe('auth.login', function() {
window.location.reload();
});
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
//]]>
</script>
Obviously I assume it’s the window.location.reload() that’s doing it, but – that’s not code I added or can edit manually.
Has anyone seen this or have any idea what could be causing it / how I can fix it?
Thanks in advance for any help / direction.
In the lastest version of the CakePHP Facebook plugin, it allows you to pass
falseto the init() call which keeps it from refreshing over and over (or even once).This doesn’t seem like the best solution, because when a facebook user comes to the page, they won’t know they’re logged in until the next pageview, but – seems to be the only solution for now.