Delete facebook session cookie from my application on users logout

后端 未结 9 1285
耶瑟儿~
耶瑟儿~ 2020-12-11 06:40

I am working in an application which is using facebook connect to log in the users using their facebook account.

Everything works fine except in the following case:<

9条回答
  •  一生所求
    2020-12-11 07:09

     APPID, 'secret' => SECRET, 'fileUpload' => true ) );
    
    // if we are being visited by someone trying to logout, lets me sure they get logged out!
    if( isset( $_GET['logged_out'] ) ) {
        setcookie( "PHPSESSID", "", (time()-3600) );
        header( "location: " . URL );
        exit();
    }
    
    // lets try to get the users id
    $user_id = $facebook->getUser();
    // try to get their access token
    $access_token = $facebook->getAccessToken();
    
    // if we have an id
    if($user_id) {
    
        // from the offset, we're good to go...
        $logged_in = true;
    
        echo "

    Logged in

    "; $params = array( 'next' => URL . '?logged_out' ); $return .= '
    logout'; }else{ // login man! $login_url = $facebook->getLoginUrl( array( 'scope' => 'read_stream, publish_stream, manage_pages, photo_upload', 'next' => URL . '?logged_in' ) ); $return .= 'Please login.'; } echo $return ?>

提交回复
热议问题