OAuthException Facebook - how to change the PHP SDK code to make sure this is taken care of
I get the following error when I try connecting via Facebook using the PHP SDK. How can I change the PHP SDK to account for this error - so that users never get this error:
OAuthException: Error validating access token: Session has expired at unix time 1344740400. The current unix time is 1344752273.
Also sometimes I lose access to the Facebook session, how can I fix that too? so that people can always connect via facebook?
I'm not using the offline_access but the new Facebook PHP SDK.
Look at this official blog post with the solution: How-To: Handle expired access tokens.
How can I change the PHP SDK to account for this error - so that users never get this error
You don’t change the SDKs code at all … what you do instead is, you go and do read up on what exceptions are and how to handle them in the PHP manual: http://www.php.net/manual/en/language.exceptions.php