Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In my opinion, I don't think your app should remain signed in while the user has already signed out of Facebook. </p> <p>One scenario where this may not be desirable is: what if I am using your app from a public computer. After I logged out of Facebook, your app still "remembers" me. And now anyone who uses this computer will assume my Facebook identity inside your app.</p> <p>I think the problem here is that you set your own cookie to remember the user's Facebook login status. Obviously, when user signes out of Facebook itself, your cookie is not cleared. So at this point your cookie is out of sync with Facebook status.</p> <p>I recommend that you don't use your own cookie for the purpose of remembering user's Facebook login status. Always rely on Facebook itself for this purpose.</p> <p>The general strategy is, whenever user comes to your app, you should check the Facebook login status by using the mechanism provided by Facebook. This way, your app will be in syn with Facebook in terms of user's login status.</p> <p>I personally use this piece of code to call Facebook Javascript API for the purpose of user login:</p> <pre><code>/* * Init code for Facebook connect */ window.fbAsyncInit = function() { FB.init({ appId : FACEBOOK_APP_ID, // App ID channelUrl : CHANNEL_URL, // Channel File status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true, // parse XFBML oauth : true }); // check facebook login status FB.getLoginStatus(function(response) { console.log("FB login status: " + response.status); if (response.status === 'connected') { showWelcome(); //display welcome message } else if (response.status === 'not_authorized') { // the user is logged in to Facebook, but not connected to the app showFbLogin(); //display Facebook Login button } else { // the user isn't even logged in to Facebook. showFbLogin(); //display Facebook Login button } }); // subscribe to facebook events FB.Event.subscribe('auth.authResponseChange', function(response) { fbAuthResponseChanged(response); }); }; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload