[英]facebook extended access token login
我有以下代码:
$facebook = new Facebook(array(
'appId' => ID,
'secret' => SECRET,
'cookie' => true));
$fb_uid = $facebook->getUser();
if($fb_uid)
{
// check if person with fb_uid as facebook id in database,
// if so log them in. If not, register them.
$fb_user = $facebook->api('/' . $fb_uid);
I then get their email address using $fb_user['email'] and facebook_id and store in the database as a means to log them in the future
有时即使该人使用facebook登录,$ fb_uid也会返回false。我认为这是因为访问令牌已过期。 如何更改此代码以合并扩展访问令牌以将用户登录到我的网站?
离线访问令牌已被弃用,因此我需要使用扩展访问令牌。
您的Cookie即将到期。 不要使用Cookie和屏幕抓取功能,而要使用OAuth。
在此处查看示例: http : //eggie5.com/20-getting-started-w-facebook-api
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.