php - Facebook re-authentication -


I am using PHP SDK to request authentication and permissions.

  $ facebook = new Facebook (array ('appId' => '7xxx34 9xx', 'secret' => gt0b360034c9exxxx4f ',' cookie '=> true) ); $ Params = array ('scope' = & gt; 'publish_actions, read_friendlists', 'redirect_uri' = & gt; 'example.com',); $ User = $ facebook-> GetUser (); $ Usertoken = $ facebook- & gt; GetAccessToken (); If ($ user) {try {$ user_profile = $ facebook- & gt; API ('/ m'); } Hold (FacebookApiException $ e) {error_log ($ e); $ User = null; }} If ($ user) {$ logoutUrl = $ facebook- & gt; GetLogoutUrl (); Header ("location: xxx.php"); } If (! $ User) {// $ statusUrl = $ facebook- & gt; GetLoginStatusUrl (); $ LoginUrl = $ facebook- & gt; GetLoginUrl ($ params); }  

It works well but if the user deletes the app in the privacy setting and tries to log in again then I have errors:

The CSRF state token does not match any of the provided. Or OAuthException: Error validating login token: User has not authorized App [APPID]

How to fix it? Do I need an extra code?

Thanks for the help


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -