Domanda

I want to show Login button and Login status as "LOGGED IN" if the user has Facebook open in any other tab of their browser, and otherwise show "NOT LOGGED IN".

È stato utile?

Soluzione

The Facebook Javascript SDK supports checking if your site's user is logged into Facebook, see here: https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/

Altri suggerimenti

To use the Facebook to determine, the user would have had to first approve your application. This can be checked with the javascript sdk:

FB.getLoginStatus(function(response) {
  if (response.authResponse) {
    // logged in and connected user, someone you know
  } else {
    // no user session available, someone you dont know
  }
});

If you just want to know if they are logged into Facebook (not your application), someone has found a loophole to detect.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top