Ruven JR. Maerson
Ruven JR. Maerson

Reputation: 309

Keep Facebook session alive?

I know there is the offline_permission option, but is there a way to keep the Facebook session alive?

Facebook generates the session from the stored cookie, so I am not sure, if a periodical API request renews the session.

Upvotes: 0

Views: 1509

Answers (1)

Antonelli
Antonelli

Reputation: 175

The offline_access extended permission keeps the token you receive alive. Checkout the documentation at: http://developers.facebook.com/docs/reference/api/permissions/

Enables your app to perform authorized requests on behalf of the user at any time. By default, most access tokens expire after a short time period to ensure applications only make requests on behalf of the user when the are actively using the application. This permission makes the access token returned by our OAuth endpoint long-lived.

You don't need to make repeat calls to keep the token active, you can just store it and use it as needed. Here's an answer that describes how to use the token with the PHP SDK: How to login with OFFLINE_ACCESS using the new Facebook PHP SDK 3.0.0?

Upvotes: 2

Related Questions