I did authorization with facebook in PHP for this example https://developers.facebook.com/docs/php/howto/example_facebook_login/
Facebook has test documentation https://developers.facebook.com/docs/facebook-login/testing-your-login-flow/
Take for example this "6. Someone changes the Facebook password after logging in with Facebook to your app".
To implement this, I take a token from the session and check whether the token has expired. I do this every time a user opens a page of the site.
Everything worked fine and the user left the session for example when changing the password from facebook. But now facebook has made rate limits and when I do a check for an expired token, it ends quickly.
I don't understand what I have to do with this. How do I check the validity of a token in PHP? Please help.
if(key_exists('fb_token', $_SESSION))
{
$tokenMetadata = facebook()->getOAuth2Client()->debugToken(
$_SESSION['fb_token']
);
if($tokenMetadata->getIsValid())
return $_SESSION['fb_user_id'];
return false;
}