Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7043743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:19:36+00:00 2026-05-28T02:19:36+00:00

How to logout the user from our site when they logged out from Facebook?

  • 0

How to logout the user from our site when they logged out from Facebook?

Currently, when user logout, the fb_*_user_id sessions is still returns users ID,

I tried to call $fb->api(‘/me’), and still, all users data is still there..

I’m really sorry for asking this question because I’m quite sure it’s being ask all the time, But seriously, FB API giving me a headache.
I’ve tried some of the code from solved question, but it doesn’t seems to work, and most of them are outdated.

I’m using PHP SDK and hosting on localhost.

Thanks

$facebook = new Facebook($config);

var_dump($facebook);
echo 'UID : '.$facebook->getUser();


if($facebook->getUser()==0){
    echo 'Not login!';
    echo "<br><a href='".$facebook->getLoginUrl()."'>Login</a><br>";

}else{
    $fbme = $facebook->api('/me');
    echo 'Welcome, "'.$fbme['name'].'"!';   
    echo "<br><a href='".$facebook->getLogoutUrl()."'>Logout</a><br>";
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:19:37+00:00Added an answer on May 28, 2026 at 2:19 am

    Try adding a listener for when the user logs out;

    FB.subscribe('auth.logout', function(response){
        // Do something to let your program know that the user is now logged out.
    });
    

    Add your own facebook logout to your site with FB.logout(). This should clear your website’s fb session as well as log them out of facebook.com.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how do you logout the user from your site in facebook api, while still
How can I log out user from facebook without authorizing him myself? I have
I have used the following code snippet to logout the user from the session.
How can I logout or disconnect a Facebook user in the Facebook connect session?
Using WebSphera 7.0.0.19. To logout user from application page after some idle time use
Before my application is going to be closed I have to logout user from
For logging out a user from my website, I am redirecting the page to
so I'm trying to program the Facebook logout feature for my site The thing
How can I login to AD without logout from current user and get new
Whenever I try to disconnect the user from my website that uses the Facebook

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.