LoginSignup
5
6

More than 5 years have passed since last update.

【facebook php sdk】ログアウトする

Posted at

ログアウトする方法

logout.php
$config = array(
    'appId'   => APPID,
    'secret'  => SECRET,
);
$facebook = new Facebook($config);
$logoutUrl = $facebook->getLogoutUrl();
//これがないとセッションを保持してしまうため、別のアカウントでログインできない
//次ログイン画面を出してもID, パスワードの画面が出ない
$facebook->destroySession(); 
header("Location: ".$logoutUrl);
5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6