-1

I am using the stock SDK for php/javascript. Now the app I am building many parts of it, if a user approves the use and accepts the permissions acts as a layer on top of facebook. Where it is planned to have my App pretty much interact with it as if the user was logged on at the time.

Previously I was playing with the offline_access but I recently read that that permission is coming out of the api completely and soon enough any tokens already in existence will just convert to 60 day tokens. I know from what I read that I can renew the tokens on a daily basis if need be when a user logs into my app. But my two biggest questions that I can't figure out one way or another is.

How do I ensure I get the "long-lived" tokens, and with these tokens do I store them on my end and pass them through the api to FB or is facebook storing these and through the use of the api the way it is and I don't need to store them somewhere. I know currently when I login it generates a token and stores it in a php session but the session is usually only good for the duration of the user being on my app. Note this is also a desktop app, not an app within facebooks canvas.

If I have to store the tokens to use them, and the php sdk bases itself off of whats stored in a session do I recreate the session with the stored access token for the user or I dunno, Im confusing myself as I type this out, hopefully someone can shed some light on the subject for me.

chris
  • 36,115
  • 52
  • 143
  • 252

2 Answers2

1

Here you can find some help on how to handle the expired tokens,
https://developers.facebook.com/blog/post/2011/05/13/how-to--handle-expired-access-tokens/

And here more info on how to use the new method,
Facebook offline access step-by-step

Community
  • 1
  • 1
Philip
  • 5,011
  • 2
  • 30
  • 36
0

All this matter always makes me doubt as well, but I have noticed that facebook usually keeps the token somewhere on the user end, probably a cookie, so that it will automatically connect. So I don't think that the token only lasts a session and I'd rather say you won't have too many problems with the depreciation of offline_access, though this might just be my personal opinion.

Pierre Arlaud
  • 4,040
  • 3
  • 28
  • 42
  • Well I know in July offline_access is slated for complete removal, and any apps that have been grandfathered in for the time being will at that point have all there tokens converted to long-life tokens, but after that life span (60 days they die) grant it I can't picture a need for that many days but more than the short life (2-4 hours) is required for my app in all. – chris Jun 17 '12 at 04:03