Nope it still seems to be happening sporadically. Some people say it still happens after a de-auth and re-auth. There doesnāt seem to be any pattern to it.
I am using PHP, and originally used the Abraham Williamsās library but I changed to tmhOAuth from āthemattharrisā to see if it helped - it didnāt.
Itās unlikely people are randomly invalidating it as I get the token when people log in via Twitter and the token is only stored in the PHP session while at the site. Their session and, therefore, token is disposed of until they next log in.
Time drift is mentioned here and there but I donāt think itās the case. If I do a random call (say āstatuses/home_timelineā) and look at the entire response. I can see:
{āerrorsā:[{ācodeā:89,āmessageā:āInvalid or expired token.ā}]}
As well as
[date] => Fri, 19 Jun 2015 13:35:18 GMT
in the response.
As a unix timestamp thatās
1434720918
In the same PHP script I echoād the date on computer and itās
Fri, 19 Jun 2015 14:35:18 BST
As a unix timestamp thatās
1434720918
Itās the same time.
Iāve made the script email me when this error happens along with the tokens that are in their session and the tokens look like tokens - not truncated or anything.
What else would cause tokens to become invalid?