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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:38:15+00:00 2026-05-30T13:38:15+00:00

I am trying to implement the Facebook Login and Logout in my website. I

  • 0

I am trying to implement the Facebook Login and Logout in my website.
I am using the Facebook PHP SDK.

The code i am using is as follows :

Login

    $facebook = new Facebook(array('appId'  => APP_ID,
                           'secret' => APP_SECRET
                           ));

    $param = array();
    $param["scope"] = array("email","offline_access","publish_stream");

    $loginUrl = $facebook->getLoginUrl($param);

Logout

    $logoutUrl = $facebook->getLogoutUrl();

The problem is logout url is not being able to logout the facebook user.

When i remove the “offline_access” from the scope parameters the logout Url is working fine.

I have also implemented the above scope in the example.php file in the PHP SDK and the result was the same.

Can anyone provide any help.

  • 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-30T13:38:17+00:00Added an answer on May 30, 2026 at 1:38 pm

    I found out my problem. After logging in from Facebook I called the function $facebook->destroySession(); and after that, called the function $facebook->getLogoutUrl();.

    Because of the destroySession() function the access_token returned from Facebook got lost and my logout URL generated from the getLogoutUrl() function could not log out the user from Facebook.

    After removing the destroySession() function my code is working fine.

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

Sidebar

Related Questions

I am trying to implement Facebook Login functionality to my website. I followed the
I have been trying to implement the Facebook Feed Dialog as follows <a href=http://www.facebook.com/dialog/feed?app_id=12345678&redirect_uri=http://example.com&link=http://example.com&message=Hi+wassup!>
I'm trying to implement the Facebook login in my app using Eclipse, so I
I'm trying to implement Facebook Connect on a website with .NET MVC using C#.
I'm trying to implement a Login with Facebook using the Open Graph API. So
Hi i was trying to implement facebook login for my django app using django-facebook
I'm trying to implement Federated Login using Google App Engine Go SDK, but the
I'm trying to implement the new oAuth2 facebook SDK into my app but can't
im trying to implement a login with facebook/twitter functionality in my app, i read
really need your help with log-in-with-facebook feature I'm trying to implement on my website.

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.