facebook connect session logout not firing

Jun 17, 2010 at 2:05 AM

i am using version 3.1 and i have integrated facebook connect into my website membership provider.  there is an onlogged out event that is meant to fire the session logout but it does not work and the user is signed in again.

has anyone come across this issue?

Jun 17, 2010 at 5:36 AM

some details posted out at stackoverflow. http://stackoverflow.com/questions/658027/logout-with-facebook/3037351#3037351

seems ConnectSession doesn't have any codes in Logout methd. Its just

void Logout(){ } 

without anything. same for Login(){}

so basically u will need to use the java-script version

that means onlogged out even is not gonna get fired.

Jun 17, 2010 at 1:27 PM
well that sucks! i have looked but cannot find an example of how to use the FB.Logout() method from code behind to sync with forms authentication.
Jun 17, 2010 at 1:36 PM

one this you could use that fires a log out method is simply a small integration within the connect button you use:

<fb:login-button autologoutlink="true"></fb:login-button>

 

the autologlink lets the user sign out by re-clicking upon the login button. with this option, the login button changes to a logout button when a user session has been initiated.

Jun 17, 2010 at 3:06 PM
thats great! but i am not displaying the facebook button once the user is logged in so i need to call this some other way. any suggestions?
Jun 17, 2010 at 4:17 PM

does the user have to click on a button? or a link? if so you could maybe try and hide the button underneath a where the user has to click - so they do click on the facebook logout button without realising it?

megan

Jun 17, 2010 at 5:14 PM

unfortunately it's not even on the same page

Jun 17, 2010 at 6:32 PM
got it! i used the following code in an button onclientclick event: fb.logoutandredirect("someurlonyoursite"); return false; the "someurlonyoursite" file then logs the user out of the site really simple even if it's not ideal or pretty.......