Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Logout Url

I'm working on an android application. The application is not based on Facebook but I added a "share" function to let the user to share of some information on Facebook.

The problem is, I'm using Air for Android developing kit, and I'm using StageWebView class to let the user go into facebook. And I made a "logout" button so the user can logout after shared. It was working as well until two weeks ago. As I learned facebook made some changes again.

I was using a simple URL to logout the user ;

swv.loadURL("http://m.facebook.com/logout.php")

but now its not working. It's just redirects to home. I need a URL link that logouts the user. What should i do to logout the user?

Thanks

like image 662
zbgokalp Avatar asked Jun 03 '11 21:06

zbgokalp


People also ask

How do I log out of Facebook URL?

The logout URL on Facebook apparently links to https://www.facebook.com/log.out#; I discovered this doing a "View shortcut" after a context-menu click on the "Log out" menu item.

How do I logout of all my Facebook accounts?

On the “Security and Login” page, next to the “Where You're Logged In” header, tap “See All.” Facebook will display the list of devices where you use your account. At the bottom of this screen, tap “Log Out of All Sessions.” On the “Log Out of All Sessions” page that opens, select “Log Out.”


1 Answers

I had the same issue today that you have, after a little digging in to the PHP SDK it looks like Facebook now requires the user's access_token to be passed.

https://github.com/facebook/php-sdk/blob/master/src/base_facebook.php

public function getLogoutUrl($params=array()) {
    return $this->getUrl(
        'www',
        'logout.php',
        array_merge(array(
            'next' => $this->getCurrentUrl(),
            'access_token' => $this->getAccessToken(),
        ), $params)
    );
}

also the url looks like it needs to be https://www. not http://m.

here is my string that now works fine,

https://www.facebook.com/logout.php?next={0}&access_token={1}

where {0} is my URL that FB will redirect to and {1} is the users valid access token.

Hope that helps.

like image 168
Jason Lavigne Avatar answered Oct 04 '22 18:10

Jason Lavigne