Login with JS and then using PHP SDK (Facebook)
I'm using this code to login my websi开发者_如何学Cte via facebook:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId:'MYAPPID', cookie:true,
status:true, xfbml:true
});
</script>
<fb:login-button>Login with Facebook</fb:login-button>
Its working well and I see my application on facebook.com/editapps.php
, but then when I want to start using PHP SDK I see that I didn't login. If I login via PHP SDK then I see that I logged in.. What is the problem here? Thank you.
What version of PHP SDK are you using? Because the latest 3.0.1 isn't compatible yet with javascript SDK. So you would need to downgrade to version 2 of the SDK until they will update the Javascript SDK too.
More info about this here: http://developers.facebook.com/blog/post/503/
精彩评论