Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isLongLived #12

Closed
mcpDeveloper opened this issue Dec 11, 2014 · 3 comments
Closed

isLongLived #12

mcpDeveloper opened this issue Dec 11, 2014 · 3 comments

Comments

@mcpDeveloper
Copy link

Hi i was checking the isLongLived function and realize that from the start return false, so it always extend the token.

i check the expires_at and it issets at 1970

@SammyK
Copy link
Owner

SammyK commented Dec 13, 2014

Hey @mcpDeveloper! Did you do a:

$token_info = $access_token->getInfo();

Before checking isLongLived()? Unfortunately isLongLived() will only have the correct expiration info if it is newly obtained from a redirect or you call getInfo() before calling isLongLived().

@mcpDeveloper
Copy link
Author

Hi
i check, and i am doing isLongLived() just right after the redirect token and it returns false, the expires_at was at 1970.

so it is necessary to do $token->getInfo() even just after the redirect or the isLongLived() will return false.

once again, thanks for your help!

@SammyK
Copy link
Owner

SammyK commented Dec 15, 2014

Unfortunately due to the limitations of v4.0 of the Facebook PHP SDK, when you obtain an access token from a redirect, it only keeps the access token data and not the expire time. But I ported FQB's AccessToken entity over to version 4.1 of the SDK and now it stores the expiration data when you obtain an access token from a redirect. But v4.1 hasn't been released yet - probably will be released by early next year.

So yes, until v4.1 of the SDK is released and I can release FQB 2.0, you'll have to call getInfo() to get the token expiration date before calling isLongLived(). Hope that helps!

@SammyK SammyK closed this as completed Dec 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants