Infinite session
alviso - February 26, 2009 - 15:35
| Project: | Drupal for Facebook |
| Version: | 5.x-2.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi Dave,
You store one Facebook ID and infinite session key with the fb_app node.
I will have the need for some of my users to enable infinite session for themselves.
How do I achieve that? Do I put them thru an infinite session test type of page?
Can you please comment.
Thanks,
Peter

#1
Facebook doesn't use the words "infinite session" so much any more. What you're interested in is the offline access extended permission. See http://wiki.developers.facebook.com/index.php/Extended_permissions
The fb_user module currently provides a simple for allowing users to add extended permissions. Right now this only works on FBML canvas pages, but should eventually work via fbConnect as well. Also you can just as easily create a page with the right fb:prompt-permission tags for your app.
If you get the user to approve that permission, then Drupal for Facebook will save their 'infinite' session in the fb_user_app table, and calling fb_api_init() with their facebook user id will get you connected to facebook as that user. The fb_actions module has an action for cron tasks which does this.
The fb_infinite module serves a different purpose. It enables the Drupal admin to save changes to the facebook config, with the permission of the app developer. This is necessary for registering feed templates, for example. Although you wont need fb_infinite even for that, if you log in via fbConnect or admin through canvas pages. One day I hope to get rid of fb_infinite.module, but for now it can be useful.
Make sense?
#2
Makes sense.
Thanks for the insight.
Peter