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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T04:05:04+00:00 2026-06-19T04:05:04+00:00

This is my code : <?php require_once(facebook-php-sdk/src/facebook.php); define(‘YOUR_APP_ID’, ‘xxxxxxxxxxxxx’); define(‘YOUR_APP_SECRET’, ‘xxxxxxxxxxxxxxxxxxxxxxxx’); $facebook = new

  • 0

This is my code :

    <?php
require_once("facebook-php-sdk/src/facebook.php");
    define('YOUR_APP_ID', 'xxxxxxxxxxxxx');
    define('YOUR_APP_SECRET', 'xxxxxxxxxxxxxxxxxxxxxxxx');
    $facebook = new Facebook(array(
     'appId' => YOUR_APP_ID,
     'secret' => YOUR_APP_SECRET,
    ));
    $userId = $facebook->getUser();
    if($userId){
         $userInfo = $facebook->api('/' + $userId);
         $fbid = $userInfo['id'];
         $params = array();
         echo '<a href='.$facebook->getLogoutUrl($params).'><div class="text-facebook"><img style="vertical-align:middle;" src="/img/fbicon.png">Logout</div></a>';                         
               }
                else{
                  $permission = array('scope' => 'email');
                  echo '<a href='.$facebook->getLoginUrl($permission).'><div class="text-facebook"><img style="vertical-align:middle;" src="/img/fbicon.png">Login with Facebook</div></a>';
                     }
?>

Login works perfectly, but when I click the Logout button it logs me out of facebook.com, but it stays logged on my website, which is exactly the opposite of what I want. I want the link to delete all facebook information from my website, but keep the user logged to facebook.

I don’t know if I explained correctly what I need, but I’ll clear things up if someone asks.

  • 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-19T04:05:05+00:00Added an answer on June 19, 2026 at 4:05 am

    If you want the user to log out from your site but stay logged in to facebook then the answer is simple:

    Don’t use facebook->getlogouturl()

    If after a successful login, you set a variable to be true, and use that to permit actions you only grant to a logged in user, then all your logout button will need to do is set that variable to false.

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

Sidebar

Related Questions

this is my code: <html> <head> <body> <?php require_once 'facebook-php-sdk/src/facebook.php'; $appapikey = '453976824647366'; $appsecret
this is my piece of php code: <?php require_once 'php/Classes/User/UserDataBaseManager.php'; require_once 'facebook/src/facebook.php'; ?> And
Came across this code: <?php require_once 'HTTP/Session/Container/DB.php'; $s = new HTTP_Session_Container_DB('mysql://user:password@localhost/db'); ini_get('session.auto_start') or session_start();
hi I am using this code to make api call: function foo(){ require_once 'facebook.php';
i have this code... require_once facebook.php; $app_id = xxxxxx; $app_secret = xxxxx; $facebook =
I got this PHP code: // connect to mysql require_once('includes/connect.php'); // include config include('includes/config.php');
I'm learning by reading this tutorial: Link Here's the code: <?php require_once 'Zend/Loader.php'; class
Here is My code : <? session_start(); require_once($_SERVER['DOCUMENT_ROOT'].'/admin/config.php'); require_once($_SERVER['DOCUMENT_ROOT'].'/admin/fonctions.php'); include '../api/facebook.php'; include '../api/xhttp.php'; $config
When I run this code: <?php require_once 'getdata.class.php'; class Header extends GetData { public
All, I have the following code: <?php require_once 'facebook.php'; $app_id = 1234; $app_secret =

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.