Facebook Developers
DocsToolsSupportNewsApps
Log In
  • Social Plugins
  • Facebook Login
  • Open Graph
  • Facebook APIs
  • Games
  • Payments
  • App Center
  • Promote Your App
  • iOS
  • Android
  • JavaScript
  • PHP
  • More SDKs
  • Facebook Object
    • api
    • getAccessToken
    • getApiSecret
    • getAppId
    • getLoginStatusUrl
    • getLoginUrl
    • getLogoutUrl
    • getSignedRequest
    • getUser
    • setAccessToken
    • setApiSecret
    • setAppId
    • setFileUploadSupport
    • useFileUploadSupport
  • FacebookApiException
    • getResult
    • getType

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 over a year ago
Facebook © 2013 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy