The openid of a WeChat user may change under the following circumstances:

A WeChat user's openid may change under the following circumstances:

1. After the user reinstalls the WeChat application, he or she will obtain a new openid.

2. After the user switches WeChat accounts on the same device, the openid stored on the device will be refreshed.

3. After WeChat users set "clear cache", they will also get a new openid.

4. If iOS users delete WeChat and then reinstall it, and Android users switch to other phones, openid will change.

5. WeChat version upgrades may also cause openid changes. 6. When the WeChat server is updated, there is a certain probability that the user's openid will be reassigned.

In summary, there are two main reasons:

Changes to user equipment, such as reinstalling WeChat, changing devices, etc., will reset openid. Maintenance and upgrade of WeChat server may lead to redistribution of openid. This is because openid is generated and maintained by negotiation between the WeChat client and the server, and is related to the user device and server. Therefore, openid cannot be regarded as a stable and unchanging unique user identification, and it is not suitable for user identification for core business . If you need a stable user ID, it is recommended to use WeChat's unionid or maintain a business userID yourself. When developing, you need to consider that openid may change, and you cannot rely entirely on it to uniquely identify a user or perform status management. When changes occur, the old openid and new openid need to be automatically associated to ensure business continuity.

Guess you like

Origin blog.csdn.net/T3165919332/article/details/132587104