即使我登出Facebook,我似乎無法將訪問令牌作爲無效訪問。如何正確捕獲訪問令牌?
if ($user) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
echo "Name: " . $user_profile['name'];
} catch (FacebookApiException $e) {
// If the user is logged out, you can have a
// user ID even though the access token is invalid.
// In this case, we'll get an exception, so we'll
// just ask the user to login again here.
error_log($e);
$user = null;
}
}
即使我登出Facebook,我仍然收到用戶名。顯然訪問令牌似乎仍然有效。我怎樣才能解決這個問題?
或者我應該只在FB環境中在iframe中測試我的應用程序嗎?
任何人?不知何故,我無法捕捉異常? – alex 2012-01-10 16:52:49