Do you really only want to exit your application, not fb, if you are logged in with fb? Which application might want to do something like this? And why? What is the use of this?
But if you really want to (hack), in index.php:
<?php require 'init.php'; // general init require 'init_fb.php'; // sets $fb_id if logged in to fb if (isset($fb_id) and !isset($_SESSION['do_not_auto_login'])) { echo "<a href='/logout'>Logout</button>"; include 'app.php'; return; } if (isset($_SESSION['do_not_auto_login']) echo "<a href='/re_login'>FB Login</button>"; else include 'html_and_js_fb_login_code_and_button.php'; include 'startpage.php'; ?>
and in logout.php:
$_SESSION['do_not_auto_login'] = true;
and in re_login.php:
unset($_SESSION['do_not_auto_login']); header("location: /");
Not perfect, but works somewhat well. Hope you get a hack!
But still, why? If you do not think that your user would like to return, ask: "How to remove my fb application from the user?" or something instead or try @DMCS answer .. Why?
source share