Unwanted redirection after connect occurs
I'm using the latest fb_connect.module. I have a custom profile page on where I either allow a user to upload an avatar or connect via facebook to use their facebook picture instead. Note that my login page does not allow logging in via connect; the only time this is used on my site is to load a custom avatar after they are already logged in on the drupal side.
Basically after the user connects, the page refreshes due to statusHandle in fb_connect.js:
else if (data.fbu) {
// User has connected.
FB_Connect.sessionStart(function(data) {
//alert("reloading because user connected.");
window.location.reload();
});
However, the server-side callback to fb_connect/session_start calls fb_connect_session_start_cb, which destroys the local drupal session and sets the user to be an anonymous user.
I still seem to be logged in after this takes place, but I'm not sure how. I am guessing the code somehow forces drupal to re-login, which is a problem for me because I have my site set up to always redirect the user to the homepage after a login.
Anyone know of a way to bounce my users back to the profile page after connecting?
- Forums:

I'm seeing this happen
I'm seeing this happen intermittently on my test website. Happy to share the details: http://second7.peppervillage.net. username: admin, password: admin to look under the hood.
The issue of form submit making the app pop out into the website version is also visible here. permission apps.facebook.com/srinikas on facebook, and try adding the sample product to the basket.
Hope this helps you see the issue and under the hood. Thanks!
Best
Srini
Edit: Will post to issue queue.
I'm dealing with the same
I'm dealing with the same issue. Each time I use facebook connect to login to the site it immediately jumps into an infinite redirect loop. I'm using 6.2 with the legacy style fb framework. I've got the module setup correctly, it raises no issues/warnings/errors so thats fine, but its only when i try to login via the Facebook Connect block.
Feel free to see it in action here..http://positionabsolute.net/wishlist/
It's easier to respond to
It's easier to respond to this sort of problem on the issue queue. So post there if you need a follow-up.
The javascript has some default behavior. You can override that, but to do so requires creating your own drupal module (at least for the time being). Read up on drupal.org how to do that. Here's the details you need to know.
Have your module include your own javascript, say custom.js. In there define Drupal.behaviors.custom (look at fb_connect.js for example). In your Drupal.behaviors.custom function, call
$(document).bind('fb_connect_status', Custom.statusHandle);and define Custom.statusHandle to do nothing, or whatever your logic is.By binding the 'fb_connect_status' event yourself, you should override the handler in fb_connect.js.
Yeah I just uncommented the
Yeah I just uncommented the alert right before the window reload and it is hitting that scenario of executing on page load and meeting the data.fbu condition. What's strange is I looked at your current version of fb_connect and it has the same code as the version I'm using but your install isn't plagued by this problem.
I'm looking into the option
I'm looking into the option you suggested with the extra event handler. But it won't actually override the default behavior but simply attach more behaviors to the event. Such that the core handler's window.location.reload will still be executed. I think the logic is just off, where the fb_connect_status executes by default for someone who has already signed in, such that when you load the page, it executes fb_connect_status which then reloads the page b/c of the handler and the cycle continues. The module otherwise has been great but I think i'm going to have to monkey patch this feature.
It's like you said, the
It's like you said, the drupalforfacebook.org site doesn't redirect more than once. I'm not sure what the problem is on your server.
Also, fb.js only binds the event if no other code has bound to it. JQuery gives you a way to unbind the default handler if you want to (which it sounds like you do).
Note in 3.x, the event name has changed to 'fb_session_change'. It will be invoked on both facebook connect pages and also iframe canvas pages. (so it is no longer fb_connect-specific.)