When developing facebook applications, we might need an infinite session that will enable us to update the app users’ profile periodically. For instance, a “Quote Of TheDay” application needs to update its users’ profile everyday with a new quote.
Here are the steps to generate an infinite session that does not expire. Note: these steps only need to be done by the developer once; no action is needed from the app users.
- Login to your own facebook account.
- Browse to: http://www.facebook.com/code_gen.php?v=1.0&api_key=YOUR_API_KEY (replace YOUR_API_KEY with your app’s API key) Click through the simple instructions on the page. After that, you’ll be provided with a one-time code like 5P4I8D .
- Invoke facebook API auth.getSession using the one-time code. The returned result will be the infinite session key.
References: http://wiki.developers.facebook.com/index.php/Authentication_guide
September 18, 2008 at 10:23 pm |
Hi.
I need to know how disable the infinite session on the application.Because my app has seperate login inside the app.Due to the infinite session i one use logged in the system then loggged out .If another user logged into the app it shows session values of previous user.Please help me this issue as soon as possible
November 18, 2008 at 1:47 pm |
Hi Murali,
I’m not exactly sure what you’re trying to describe. But in case it’s of any help to you, Facebook infinite sessions are always disabled unless you explicitly enable them.
January 19, 2009 at 9:10 am |
Here’s a more thorough explanation that I just finished writing up, as well as how to use the acquired infinite session key. Hope it helps!
http://www.emcro.com/blog/2009/01/facebook-infinite-session-keys-no-more/
April 10, 2009 at 12:02 am |
[...] How to generate facebook infinite session « Tech Notes @ Fernvale When developing facebook applications, we might need an infinite session that will enable us to update the app users’ profile periodically. For instance, a “Quote Of TheDay” application needs to update its users’ profile everyday with a new quote. (tags: api facebook sessions social) Share and Enjoy: [...]