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 8121919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:39:39+00:00 2026-06-06T05:39:39+00:00

I’m using the FB PHP SDK to get a user’s FB access token etc.

  • 0

I’m using the FB PHP SDK to get a user’s FB access token etc.

After I’m done getting all my info, I am attempting to logout the user, but it doesn’t work. For debugging purposes, I’m doing this:

$facebook = new Facebook(array(
        'appId' => FB_APP_ID,
        'secret' => FB_SECRET
    ));
$params = array( 'next' => site_url('welcome/logout') );
$link = $facebook->getLogoutUrl($params); // $params is optional. 
echo $link;

This gives me a link like this:

https://www.facebook.com/logout.php?next=http%3A%2F%2Fexample.com%2Fwelcome%2Flogout&access_token=xxxxxxxx

If I point my browser to that URL, I get redirected back to my callback URL, but immediately after, if I go to Facebook.com, I’m still logged in.

What am I doing wrong?

I tried using the JS SDK but that doesn’t work because everything else is being done server side (using the PHP SDK). So, when I call FB.logout() using the JS SDK, it says Logout called without access token.

EDIT

I suppose before proceeding further, could someone confirm this:
When I follow the logout URL, does it actually log me out of Facebook, or just end the session between my app and the user?

If that is so, is there any way to completely Log out the user from Facebook? (I’m guessing no).

  • 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-06-06T05:39:41+00:00Added an answer on June 6, 2026 at 5:39 am

    RE: using the JS SDK, you can use both the JS SDK and the PHP SDK at the same time, interchangably now (and have been for about a year). SO if the JS method suits you better, I suggest you try that.

    RE the “Edit”: Yes, it completely logs you out of Facebook.

    Now for the opening feature question. The scenario you desribe happens during development, but I’ve never pinpointed why. I think it’s to do with the cookie being stored at the wrong domain (facebook stores what it thinks is the base domain, and if you fiddle with the base domain, or have two applications on the same base domain, the it gets those in a twist).

    Clearing cookies sorts it out. Then make sure you don’t manipulate domain in the settings in Facebook and it’ll hopefully not reappear. (I say hopefully as I’ve never exactly pin-pointed the trigger, but I’ve never had it happen to a stable app once development has finished.)

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,

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.