Was testing out and found that at some point when I call mysqli_offline_access_to_google.php, the refresh token is cleared in the db.
It looks like this happens the day after the token was set, but before the actual expiry.
The result is that it cannot refresh the token when it expires. After that, I cannot use either mysqli_offline_access_to_google.php or mysqli_login_with_google.php until I delete the the record for that user in the db.
John Rambelle - 2013-06-25 11:50:14 - In reply to message 5 from John Rambelle
There is still a bug here. It is masked if a user has multiple sessions in the db (from different PCs for instance) since the GetUserSession SQL uses only user and server in the where clause:
SELECT id, session, state, access_token, access_token_secret, expiry, authorized, type, server, creation, refresh_token FROM oauth_session WHERE user=? AND server=?
It can pick up the refresh token from a session that was created on a different PC and will refresh the access_token. If I delete that record in the db, then I still experience the issue where the refresh_token is lost. If I save the refresh_token manually and restore it after it is lost, it will happily refresh the access_token.