I downloaded the PHP SDK from Github (https://github.com/facebook/facebook-php-sdk) on my server, but cannot get example.php to work:
- When I open example.php in Safari, I get - you are not connected
- I click the login link
- I enter a user and go to Facebook
- The browser redirects back to my example.php - there is "state" and "code" in the URL
- example.php still shows that "you are not connected" (this is the essence of my problem)
- If I add:
print $facebook->getAccessToken(); - it prints an Access Token (!!!)
So my question is: what is the problem of example.php? If I have a Facebook access token, why does $facebook->getUser() not return anything?
How to make example.php work so that I can continue to develop my own logic?
PS: at the same time, an example of PHP code here: https://developers.facebook.com/docs/authentication/ works fine, so it looks like I have a problem with php -sdk from Github ... is the Github library stable or rather unfinished, which cannot be used for production?
source share