Download & Extend

Drupal.settings.fb.reload_url does not reload page in Chrome, Safari

Project:Drupal for Facebook
Version:7.x-3.3-beta5
Component:Facebook Connect
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

This baffles me. I've read the README.txt and documentation on drupal.org.

I am using the following code to log a user in and refresh the page:

global $base_url;
$url = url($base_url . request_uri(), array('absolute' => TRUE, 'fb_canvas' => fb_is_canvas()));

echo '<a href="#" onclick="Drupal.settings.fb.reload_url=\'' . $url . '\';FB.login(function(response) {}, {perms:Drupal.settings.fb.perms}); return false;">';
echo 'Login';
echo '</a>';

This works fine in Firefox, but only rarely in Chrome or Safari. Most of the time the redirect simply does not happen.

I saw Dave Cohen suggest the following in http://drupal.org/node/1476746:

Use firebug or chrome console, put breakpoints in FB_JS.authResponseChange, FB_JS.sessionChangeHandler, and FB_JS.reload. See which if any are gettings called. They should each get called, in that order.

So I did this, and none of these are called when the redirect doesn't occur. They are all called when the redirect does work, which seems to be at random in Safari and Chrome.

Any suggestions?

Comments

#1

Does www.drupalforfacebook.org reload for you when you connect there?

Does your site reload if you use a connect button rendered by the modules? I.e. the facebook connect block?

Find the settings on both browsers to enable third-party cookies. Probably enabling that will make it work.