Pergunta

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".

Foi útil?

Solução

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/

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top