Tetiana
Tetiana

Reputation: 361

Facebook manual logout

I have .net web site which designed for working as standalone application. Due to one issue I was made to perform login flow to Facebook manually instead of calling FB.login(from FB javascript sdk). And because of this I am not able to call FB.logout (because in this case another issue appears). Facebook support advised me this: "In this case, you should manually clear the user's logged in session, by clearing any stored cookies, or removing any access tokens or user information stored on our end. You can refer to this page for more information on building login/logout flows manually: https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/#logout" I didn't get this answer. How to realize manually logout workflow? And I didn't find any examples.

Upvotes: 1

Views: 5878

Answers (1)

C3roe
C3roe

Reputation: 96250

You can check what the PHP SDK’s getLogoutUrl method does here, https://github.com/facebook/php-graph-sdk/blob/5d0c4865e80e231d48a4571841bd018828fe58e1/src/Facebook/Helpers/FacebookRedirectLoginHelper.php#L156

Basically it just calls https://www.facebook.com/logout.php with two parameters:

  • next is the redirect URI the user should be redirected back to after logout; it needs to be within your app domain
  • access_token is the valid user access token for the current user of your app

Upvotes: 0

Related Questions