即使我退出 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,我仍然可以取回用户名。所以显然访问令牌似乎仍然有效。我怎样才能解决这个问题?
或者我应该只在 iframe 的 FB 环境中测试我的应用程序吗?