[Yes, me again...]

* I log into my site, which gets me successfully logged into Facebook as well as the site. All's well.

* I have my site in one browser tab, and Facebook in another.

* I log out of Facebook in the Facebook tab, through the usual "Log Out" link.

* I go back to my site and click on the logout link that was there when the page was written. Nothing visible happens (at all); however, there is an error message in the JS console: "Refused to display document because display forbidden by X-Frame-Options.". Repeated clicks on the logout link produce the message again.

* If I go back to the Facebook tab, log in again, return to the site tab, and click 'logout' again, the error message appears again. If I go to other parts of my site that require a FB connection, I find that the connection (access token) has been lost. No surprise there, I guess.

Any insights / suggestions? Thanks!

Comments

james.williams’s picture

I hit this as well today. http://stackoverflow.com/questions/6666423/overcoming-display-forbidden-... seems to be related and might hold the solution.

I find that when I click logout the second and subsequent times, I get the console error, though if I navigate elsewhere in my site, I am then logged out. Perhaps the logout handler that attaches to the logout link needs disabling after executing the first time? Doing this works for me, but I wonder if it is necessary that it stays around, in case the handler failed to log the user out of facebook?

Dave Cohen’s picture

Confirmed this on drupalforfacebook.org. I'm pretty sure this is a new problem. Probably a recent change to facebook's JS.

The suggestion on stackoverflow looks horrible.

Perhaps the logout handler can perform some test to confirm still logged in. Perhaps the logout handler can no longer be made to work at all, instead the php code should always handle it. If I recall correctly the PHP will forward the browser to a facebook URL to log the user out.

Could one or both of you try commenting out


  // Logout of facebook when logging out of drupal.                                                                                                       
  jQuery("a[href^='" + Drupal.settings.basePath + "logout']", context).click(FB_Connect.logoutHandler);


in fb_connect.js and then see if how the logout link behaves? (Both with logged into facebook and when logged out in another tab). I'll test it when I get a chance, but not sure when that will be.

Hammad.Chishti’s picture

nothing happens, i got same result.
Loggout button still doesn't work seems like it stops talking with fb_connect.js.

jim_at_miramontes’s picture

Hmm. I've been making a bunch of fixes to my login process (unrelated to all this other stuff), and backed out to v. 6.x-3.1 along the way. When I do the original chain of events I first reported on and click on the logout link, I see the X-Frame-Options message fly by in the console window, but then the page refreshes and I'm successfully logged out of my site, with no further action required. If I didn't have the console window open to look for this stuff, I wouldn't have noticed that anything was wrong. I'll try to look in on the dev version later.

Hammad.Chishti’s picture

I got another error on logout,
responseText: "
Fatal error: Call to undefined function dpm() in
/home/dubaiper/public_html/sites/all/modules/fb/fb.module on line 838
↵"
textStatus: "parsererror"

vishalchavda’s picture

Version: 6.x-3.x-dev » 6.x-3.2-rc3
Priority: Normal » Critical

Hello
I am too getting this error code on my Live site at www.thatscookedby.com

I enabled the module as per instructions and am getting this error.
Fatal error: Call to undefined function dpm() in /home/.../public_html/sites/all/modules/fb/fb.module on line 838

Cant access my site. Help please
Using Latest fb 6.x-3.2-rc3 module and Druoal 6.22

Vishal

james.williams’s picture

@vishalchavda and @Hammad.Chishti -- use the latest 6.x-3.x-dev snapshots -- these contain the fix for the 'undefined function dpm()'.

This issue is about the "Refused to display document because display forbidden by X-Frame-Options." error, please don't post on this ticket about other errors unless your error is definitely related.

Hammad.Chishti’s picture

Thanks for the reply James,

Just curiosity, is this fixed Logout issue, infinite redirects and dpm problems.
Actually I am working on different project i didn't get much time to check these stuff.
Please let me know
thanks

aleada’s picture

I made some changes on fb_connect.js

FB_Connect.logoutHandler = function(event) {
  // If we need to reload, go to front page.
  Drupal.settings.fb.reload_url = Drupal.settings.fb_connect.front_url;
  if (typeof(FB) != 'undefined') {
    try {
      FB.logout(function () {
        // Logged out of facebook.  Session change event will log us out of drupal and
      });
      // Facebook's invalid cookies persist if third-party cookies disabled.
      // Let's try to clean up the mess.
      // @TODO: is this still needed with newer oauth SDK???
      //FB_JS.deleteCookie('fbs_' + FB._apiKey, '/', ''); // app id
      //FB_JS.deleteCookie('fbs_' + Drupal.settings.fb.apikey, '/', ''); // apikey

      /*if (FB.getUserID()) { // @TODO: still needed with newer oauth SDK???
        // Facebook needs more time to log us out. (http://drupal.org/node/1164048)
		return false;
      }*/
    }
    catch (e) {
	  return false;
    }
  }
  else {
    return false;
  }
};

and it works fine...

miccelito’s picture

@amatech

Thanks! Needs only one click on logout link now to be logged out. Works in FF and Chrome (hopefully even in IE and Safari). However drupal's db log shows an error message related to logout process:
"fb_api_check_session failed.: An active access token must be used to query information about the current user. 0
OAuthException: An active access token must be used to query information about the current user."

But I suppose that at the moment your solution is more userfriendly than having to click logout link twice...

edit: I made a small change in settings.php and hereafter there are even no more error messages in db log.