问题
I am using the facebook php sdk for a one-click login and registration. After a user is authenticated I am adding the user to my own db and session and then I want to immediately delete the facebook session.
I cant find any documentation on how to delete the facebook session without deleting my own session.
Thanks
回答1:
This seems to work:
if (isset($_SESSION['fb_' . FB_APP_ID . '_code'])) {
unset ($_SESSION['fb_' . FB_APP_ID . '_code']);
}
if (isset($_SESSION['fb_' . FB_APP_ID . '_access_token'])) {
unset ($_SESSION['fb_' . FB_APP_ID . '_access_token']);
}
if (isset($_SESSION['fb_' . FB_APP_ID . '_user_id'])) {
unset ($_SESSION['fb_' . FB_APP_ID . '_user_id']);
}
Not sure if there is already a method in the sdk that does this for you?
来源:https://stackoverflow.com/questions/11842301/delete-facebook-session-after-login-with-php-sdk