In addition to authorization string, save credentials (api_token, username & password) to cache file. Then when loading, check to see if credentials are the same. If so, then use the cached authorization string. If they've changed, then throw away cache file and re-authorize.
In addition to authorization string, save credentials (api_token, username & password) to cache file. Then when loading, check to see if credentials are the same. If so, then use the cached authorization string. If they've changed, then throw away cache file and re-authorize.