Facebook getUser() function returning user ID after logout

后端 未结 5 1218
梦谈多话
梦谈多话 2020-12-28 18:28

I\'m developing using the Facebook PHP SDK.

I wanted to make it so that when the user logs out of Facebook, they will automatically be logged out of my website too.<

5条回答
  •  北海茫月
    2020-12-28 18:57

    I have the same issue!

    The FB PHP SDK saves those things into the $_SESSION! You can delete them like this when your user clicks logout:

    $_SESSION['fb_'.APP_ID.'_user_id'] = '';
    $_SESSION['fb_'.APP_ID.'_access_token'] = '';
    

    Although this is not the final solution, it works for now.

    I appreciate comments and solutions on that!

提交回复
热议问题