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

getLoginStatusUrl

Facebook::getLoginStatusUrl( $params=array() )

Returns a URL based on the user’s login status on Facebook. You can get a different URL depending on whether the user is logged in, not connected, or logged out of Facebook.

Example

$params = array(
  'ok_session' => 'https://www.myapp.com/',
  'no_user' => 'https://www.myapp.com/no_user',
  'no_session' => 'https://www.myapp.com/no_session',
);

$next_url = $facebook->getLoginStatusUrl($params);

Parameters

This method takes an optional $params associative array containing the following key and value pairs:

Name Description
ok_session (optional) URL to return if the user is logged in to Facebook. You'll get your current App URL if this is not specified.
no_user (optional) URL to return if the user is logged out of Facebook. You'll get your current App URL if this is not specified.
no_session (optional) URL to return if the user is not connected (i.e. we have no idea if they are even a Facebook user). You'll get your current App URL if this is not specified.
Updated over a year ago
Facebook © 2013 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy