次のコードがあります。
$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を返すことがある…アクセストークンの有効期限が切れているためだと思います。このコードを変更して拡張アクセス トークンを組み込み、ユーザーが自分のサイトにログインできるようにするにはどうすればよいですか?
オフライン アクセス トークンは廃止されたため、拡張アクセス トークンを使用する必要があります。