Facebook Developers
DocumentationSupportBlogAppsLog In
  • Getting Started
  • Core Concepts
  • Advanced Topics
  • SDK Reference
    • JavaScript SDK
    • PHP SDK
    • iOS SDK
    • Android SDK
  • Tools
  • Core Methods
    • FB.api
    • FB.init
    • FB.ui
  • Auth Methods
    • FB.getAuthResponse
    • FB.getLoginStatus
    • FB.getSession
    • FB.login
    • FB.logout
  • Event Handling
    • FB.Event.subscribe
    • FB.Event.unsubscribe
  • XFBML Methods
    • FB.XFBML.parse
  • Canvas Methods
    • FB.Canvas.Prefetcher.addStaticResource
    • FB.Canvas.Prefetcher.setCollectionMode
    • FB.Canvas.getPageInfo
    • FB.Canvas.hideFlashElement
    • FB.Canvas.scrollTo
    • FB.Canvas.setAutoGrow
    • FB.Canvas.setDoneLoading
    • FB.Canvas.setSize
    • FB.Canvas.setUrlHandler
    • FB.Canvas.showFlashElement
    • FB.Canvas.startTimer
    • FB.Canvas.stopTimer

FB.logout

SDK Reference › JavaScript SDK › FB.logout

Overview

Log the user out of your site and Facebook

Example

FB.logout(function(response) {
  // user is now logged out
});

Best Practices

FB.logout will log the user out of both your site and Facebook. You will need to have a valid access token for the user in order to call the function.

Calling FB.logout will also invalidate the access token that you have for the user, unless you have the offline_access permission.

Parameters

NameTypeDescription
cbFunction

The callback function.

Updated about 7 months ago
Facebook © 2012 · English (US)
AboutCareersPlatform PoliciesPrivacy Policy