[英]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.