Development of WeChat Red envelopes

Source: Internet
Author: User
Click on the menu to collect red envelopes, the rule is to click a maximum of 1 red envelopes, and now the problem is sometimes card can be out of two red envelopes so businesses should not be lost to death, I did before is through the database record screening, led the Red Packet Network database cuttings records, but tried useless, after thinking through the session, for each user, In the red envelopes to a session, go out to clear the session, so that will not cause users to appear two of the same red envelopes, but the session did not test, we have what good way??

Reply content:

Click on the menu to collect red envelopes, the rule is to click a maximum of 1 red envelopes, and now the problem is sometimes card can be out of two red envelopes so businesses should not be lost to death, I did before is through the database record screening, led the Red Packet Network database cuttings records, but tried useless, after thinking through the session, for each user, In the red envelopes to a session, go out to clear the session, so that will not cause users to appear two of the same red envelopes, but the session did not test, we have what good way??

Click, execute a function, this function is to collect a red envelope, it is impossible to card this function to execute two times it?

If the session is used, if the user receives a red envelope, empties the cookie, and then re-receives the red envelope, the same user will receive multiple issues
It is recommended to use Redis to store the user information of the received red envelopes, to prevent users from emptying the cookie brush red envelopes, nor two of the same red envelopes.

can be resolved with token hidden domain.
Check tokens when requesting a red envelope, and delete after verification is successful.

Unable to trust the input from the client

  • 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.