即使我登出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