How to limit the verification code to use only once

Source: Internet
Author: User
How to restrict the verification code to use only once

Suppose there is an activity that has been implemented: each account can only participate once.
In the case of a verification code, if someone through the acquisition of a verification code, by submitting the same verification code, switch different accounts to participate in the activity.
This approach is not achievable, if so, how to avoid it! Verification code and account number through some encryption binding, when submitted to verify?


------Solution--------------------
You can do this, add a verification code in the database field to set a unique property, as long as a login to the verification code to the account a verification code, so it can not be bound
------Solution--------------------
Do not know your specific implementation, suggest session or cookies after the user entered the verification code, immediately destroy the current value.
The verification code can be made longer, such as 5-6-bit, in order to reduce the mechanism to bring about duplication.
Hope to help you!!!
------Solution--------------------
So, provide a way of thinking.

Write the verification code that has been used to the data table, and then each time the user submits a verification code, the database is queried once, and there is a field that distinguishes whether the code has been used. This prevents the verification code from repeating, similar to the invitation code.

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