Login Status

These examples show you how to retrieve a person's login status, and to track any changes to that status.

Checking Login Status

The FB.getLoginStatus() function in the SDK will return the current login status of the user, and this example will show that response status in the log (look for 'Status Response' entries).

Tracking Status Changes

The FB.Event.subscribe() function can be used to track auth.StatusChange events which will fire whenever a user's login status changes in any way. Try using the login button below to log in, or log out and see how each change fires an event (look for 'Status Change Event' entries in the log):

Related Guides

Read our guide to using the JavaScript SDK for Facebook Login to see the best way to use Facebook Login.