문제

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

도움이 되었습니까?

해결책

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/

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top