Why to get access token every time(on every request)?

35 views
Skip to first unread message

kissrobber

unread,
Feb 7, 2012, 3:38:22 AM2/7/12
to facebooker
Facebooker2::Rails::Controller#current_facebook_user

Facebooker2::Rails::Controller#oauth2_fetch_client_and_user

Facebooker2::Rails::Controller#oauth2_fetch_client_and_user_from_cookie

Mogli::Client.create_from_code_and_authenticator
this method calls facebook api(https://graph.facebook.com/oauth/
access_token?...) for get an access token. It seems not good to
performance.

However, it's called in every reqeust calling current_facebook_user or
current_facebook_client.
Why does it not cache the access_token in cookie etc?

Mike Mangino

unread,
Feb 7, 2012, 9:40:01 AM2/7/12
to faceb...@googlegroups.com
This is up to you to do. If you care about immediately detecting and handling logout, you can do this on every request. If not, you should cache the resulting information.

Mike

> --
> You received this message because you are subscribed to the Google Groups "facebooker" group.
> To post to this group, send email to faceb...@googlegroups.com.
> To unsubscribe from this group, send email to facebooker+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/facebooker?hl=en.
>

Reply all
Reply to author
Forward
0 new messages