this is a kinda nasty little bugger.  the facebook published way is to call 
FB.logout() (assuming you are using the javascript FB API) after you call 
the web2py logout function:

var SM = {
  'facebookLogout' : function () {
    FB.logout(function(response) {
      $(location).attr('href', '/auth/logout');
    });
    return false;
  },
  'logout_user' : function () {
    var my_id = "fbs_"+ fb_id.toString();
    if (document.cookie.indexOf(my_id) != -1){ //if Facebook Cookie Exists, 
then we have a facebook user and call FB.logout
      SM.facebookLogout();
    }        
    else{
      $(location).attr('href', '/auth/logout');
    }
    return false;
  },
};


now that also logs you out of facebook.

my coworker working on starmakerstudios.com tried to find and delete the FB 
cookie, but it did not work consistently.  apparently trying to ask the 
browser to delete cookies is like taking a cat for a walk.

the trouble is that the facebook javascript API assumes that once you login 
to the site that you want your login preserved forever.

good luck!

cfh

Sorry to bother you.
I have a quick question. I'm close to finish the facebook integration
with my application but I still have few issue.
My Logout doesn't seems to work properly. Right now when I logout here
is what I do in the function logout():
def logout():
next = URL(r=request,c='default', f='index')
del session.redirect_uri
del session.token
del session._Session__hash
auth.logout(next)
So once doing that the application successfully redirect me to the
logout page... Next when I tried to log back in the application login
me IN WITHOUT going through Facebook login page (It Authenticate in
the back-end). I guess this is because of the FaceBook Cookies in the
browser and by login out from my application I can't delete that
cookies. (This happen even WITHOUT any Facebook session active in
another tab of the browser...).
Do you know how my log out can clear out the cookies so that next time
I log back in the Facebook connect page appear ?
Thanks,
Yannick P.

Reply via email to