views:

461

answers:

1

hey

i am using facebook connect and authenticate the user with it.

for each user there is session key that expire after X minutes.

how can i get the user session after the session is over ?

i try

FB.Connect.requireSession();

but i dont want to use this function because it pops up the facebook connect username and password. i want to get the user session without him to reenter his username and passowrd/ and i dont want to ask for infinity session.

thank u all.

A: 

You have to prompt for extended permissions with offline access. When this is completed facebook gives you a special infinite session key which you need to save and use when you want to act on that user's behalf.

FB.Connect.showPermissionDialog("offline_access", function(result){ 
   //callback function when users accepts extended permissions
});

http://wiki.developers.facebook.com/index.php/JS_API_M_FB.Connect.ShowPermissionDialog

AdamB