Facebook Login: How to combine JavaScript with PHP SDK?

后端 未结 5 1515
温柔的废话
温柔的废话 2020-12-08 15:04

How do I go about combining examples from both

https://github.com/facebook/php-sdk/blob/master/examples/example.php and https://github.com/facebook/connect-js/blob/m

5条回答
  •  再見小時候
    2020-12-08 15:52

    I just use the Facebook login button - https://developers.facebook.com/docs/reference/plugins/login/

    Once the user has used that to login (if they weren't already) and grant access to your app (site), the PHP-SDK should have no trouble using the Facebook session and APIs.

    Update

    I just tried this with the new version 3.0 PHP SDK and it is definitely not working. Found this on the developer blog

    If you are using the JavaScript SDK for login in conjunction with the PHP SDK, you will want to wait for the JavaScript SDK upgrade (coming in 4 weeks). Version 3.0.0 of the PHP SDK won’t cooperate with the current JavaScript SDK due to the cookie format changing.

    In other words, use the v2 PHP SDK until the JS SDK is updated.

提交回复
热议问题