ccoenraets / OpenFB

Micro-library that lets you integrate browser and Cordova apps with Facebook with no plugin or SDK dependency.
MIT License
505 stars 231 forks source link

Facebook logout on device not working #50

Closed joshuaohana closed 9 years ago

joshuaohana commented 9 years ago

I cannot get Facebook logout to work on device properly (it clears session and everything just fine but doesn't actually log the user out of Facebook, eg: so they can log in as a different Facebook user).

Per the note in openfb.js "* IMPORTANT: For the Facebook logout to work, the logoutRedirectURL must be on the domain specified in "Site URL" in your Facebook App Settings", I have my Facebook domain settings points to the proper localhost so that logout works correct when testing locally, but I don't know how to handle this on my device.

When I try to view what the baseURL would be on device I just get "file:///private", which Facebook won't accept as a valid site URL for me to test with.

How can I perform a successful Facebook logout from device?

jadman02 commented 9 years ago

having the same issue

jadman02 commented 9 years ago

I used this suggestion and now logout works for me:

afavre commented 23 days ago I found a solution that works for me in Cordova. I used the plugin Phonegap-Cookies-Plugin (https://github.com/bez4pieci/Phonegap-Cookies-Plugin). Add the following line window.cookies.clear() in logout function of openfb.js script (https://github.com/ccoenraets/OpenFB):

if (runningInCordova) { window.cookies.clear(); setTimeout(function() { logoutWindow.close(); }, 700); }

joshuaohana commented 9 years ago

Thanks jadman02, worked like a charm

jadman02 commented 9 years ago

Hey @joshuaohana...having a problem with facebook identifying the user...have u had this problem?

I added v2.2 to the login URL (because otherwise login won't work after April 2015) and now none of the facebook calls work...but it does work without the v2.2

var FB_LOGIN_URL = 'https://www.facebook.com/v2.2/dialog/oauth',