How to store the "subscription number" on WeChat and use it on other pages

Source: Internet
Author: User
Tags openid
I am developing a voting system and need to identify the number of user votes based on the user's openid. Problem: I can get the openid through the public account subscription and click events, and then I will save the openid to the cookie or session immediately. Then, when other webpages are opened, this cookie or... I am developing a voting system and need to identify the number of user votes based on the user's openid.
Problem:
I can get the openid through the public account subscription and click events, and then I save the openid to the cookie or session immediately. Then, when other webpages are opened, the cookie or session value is empty. Is there any way to save the openid for other pages of the project?

Then I saw another subscriber account also performing a voting activity. It didn't even have a custom menu. After paying attention to it, I posted a text message, after entering the address, you can determine the number of votes on this number. In addition, this address cannot be voted if it is entered elsewhere, so it should have been determined by the openid. I have read his jump address and did not include the openid parameter, so how does he store this openid for other pages?
This public account is a baby voting activity in "Eat all over Foshan". Can anyone explain it to me ??? Urgent...

Reply content:

I am developing a voting system and need to identify the number of user votes based on the user's openid.
Problem:
I can get the openid through the public account subscription and click events, and then I save the openid to the cookie or session immediately. Then, when other webpages are opened, the cookie or session value is empty. Is there any way to save the openid for other pages of the project?

Then I saw another subscriber account also performing a voting activity. It didn't even have a custom menu. After paying attention to it, I posted a text message, after entering the address, you can determine the number of votes on this number. In addition, this address cannot be voted if it is entered elsewhere, so it should have been determined by the openid. I have read his jump address and did not include the openid parameter, so how does he store this openid for other pages?
This public account is a baby voting activity in "Eat all over Foshan". Can anyone explain it to me ??? Urgent...

I have just finished voting for over 400 million votes.

The authenticated public accounts can be used for authorized login. In this mode, only openid is obtained for non-logon users.

Authorization to obtain user information

Then, use the openid to obtain the followers information to determine whether the followers are followed,

If you pay attention to it, you will vote. If you do not pay attention to it, you will first pay attention to it.

Other specific practices, I think you can.

LocalStorage?

Method 1: directly put in input type = "hidden"
Method 2: Put in cookie
Method 3: Put it in the session
Method 4: Put in memcache and other caches

Er, er, there should be something to add downstairs.

For the same account, each user's openid is the same and can be stored persistently or temporarily as needed.

In the voting system, you 'd better record the openid to the database, which can limit the number of votes and prevent ticket swiping. If you exist locally, the user who uses the voting system clears the browser cache, it's useless.
For sessions, cookies, and localStrong on other pages

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.