Search code examples
facebook-graph-apifacebook-ios-sdk

IOS facebook SDK sessions?


In facebook API there are different states of the sessions : FBSessionStateCreated FBSessionStateCreatedTokenLoaded FBSessionStateOpen

  1. What I have understood is that the SDK caches the token. But what is the meaning of session here? Is it just an object or any connection between facebook and application?

  2. When does the token becomes invalid? Or is it always valid once authenticated for the particular app?

  3. An what is the meaning of FBSessionStateOpen? if we (or SDK) already have the access-token can't it access all the information using that?

Can anyone explain what happens under the hood?


Solution

  • As I have understood it:

    1. The session is just an object which primarily consists of a token.

    2. The token is valid 60 days, unless you call the sign out method or anything else changes.

    3. The FBState open is when the state is open, i.e. as long as the session is valid and you have a valid token.