WeChat H5 can't get OpenID after refresh?

Source: Internet
Author: User
Keywords Micro-mail PHP
Tags oauth openid
I do not know if you have encountered such a situation:

After OAuth obtains the user information, and correctly enters the H5 page, then click on the upper right corner ··· , click Refresh. The problem occurs: You cannot get the user again openid .

How are you guys going to solve this? Do I know refresh_token of one that is used to solve a similar situation?

Reply content:

I do not know if you have encountered such a situation:

After OAuth obtains the user information, and correctly enters the H5 page, then click on the upper right corner ··· , click Refresh. The problem occurs: You cannot get the user again openid .

How are you guys going to solve this? Do I know refresh_token of one that is used to solve a similar situation?

Obviously, you get openid the way you need to start code-based, after the refresh without saving your openid or last time access_token , the last code is invalid, so must not get the user's OpenID,
Besides, if you openid can't get it, you can use it refresh_token to get it back.openid

You can use the cache to record OpenID or to return to the authorization page when no open is available.

Write a session.

Get the user information after you need to store AH brother!!!

I think you should take a closer look at the business process : https://github.com/thenbsp/wechat/wiki/o ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.