Facebook Developers
DocumentationSupportBlogAppsLog In
  • Getting Started
  • Core Concepts
  • Advanced Topics
  • SDK Reference
    • JavaScript SDK
    • PHP SDK
    • iOS SDK
    • Android SDK
  • Tools
  • Downloads
    • Download the PHP SDK
  • Facebook Object
    • api
    • getAccessToken
    • getApiSecret
    • getAppId
    • getLoginStatusUrl
    • getLoginUrl
    • getLogoutUrl
    • getSignedRequest
    • getUser
    • setAccessToken
    • setApiSecret
    • setAppId
    • setFileUploadSupport
    • useFileUploadSupport
  • FacebookApiException
    • getResult
    • getType

setAccessToken

SDK Reference › PHP SDK › setAccessToken

Facebook::setAccessToken($access_token)

Set the current access token being used by the SDK. This is useful if you've acquired an access token via other means and would like the SDK to use the same token.

Example

// Set a new access token, by first getting it via means other than the SDK
$facebook->setAccessToken($new_access_token);

Parameters

Name Description
access_token New access token to use for the SDK.
Updated about 8 months ago
Facebook © 2012 · English (US)
AboutCareersPlatform PoliciesPrivacy Policy