WeChat open platform, the registered mobile App, do WeChat land development;
Steps:
(1) through the App code, access token value
https://api.weixin.qq.com/sns/oauth2/access_token? Appid=APPID& Secret=SECRET& Code=CODE& Grant_type=authorization_code
(2) the token information to the server cache file a.t xt, at the same time take the openid deposited in the database;
(3) in another account login, to judge whether there is a cache file, there is a direct access to information (openid), to determine whether a database user, does not exist, retrieve, exist, return the user information, when the bug is are the same person [because of the cache file];
Problem: how to cache the token information, with each landing to get token seems not so good, but new users openid is obtained from the interface;
Official says: refresh_token has a longer period of validity (30 days), after the failure of refresh_token, require users to authorization,
This place is not very understand how to handle?
Bosses, please show this place to how to deal with is appropriate? Thank you,