
Vitaly Dyatlov - 2013-03-26 09:45:50
Server can return 2 types of expiries:
"expires" and "expires_in"
expires - absolute expiration date, like token will expire at 10 Dec 2014
expires_in - relative expiration time, like token will expire in 3 days.
But you work with both types in the same way:
$this->access_token_expiry = gmstrftime('%Y-%m-%d %H:%M:%S', time() + $expires);
Below is my fix for this:
//FIXED expires issue
if( IsSet($response['expires']) )
{
$this->access_token_expiry = gmstrftime('%Y-%m-%d %H:%M:%S', $expires);
}
else
{
$this->access_token_expiry = gmstrftime('%Y-%m-%d %H:%M:%S', time() + $expires);
}