Can I use the cookie c_user set by facebook?

2019-09-07 05:22发布

问题:

Can I use cookie named c_user which contains the userid of facebook users who logged in? If it can be accessed by facebook php api, please provide me link.

$session = $facebook->getSession();

Few suggested to use this above code to get session, but this function is not defined in facebook-php-sdk.

Please show me a way to get user id of user currently logged in. Thanks

回答1:

Please show me a way to get user id of user currently logged in.

From http://developers.facebook.com/docs/reference/javascript/

FB.api('/me', function(response) {
  alert('Your name is ' + response.name);
  alert('Your id is ' + response.id);
});