How to avoid comparing verification code errors on the server when logging in

Source: Internet
Author: User

Problem: WebApp Phone Verification Code login often appear captcha error login failed.

Analysis Reason: The authentication method of the login is written on the service side through the general processing program, each time through the Ajax access to the general processing program to return the success or failure, finally, the foreground input mobile phone number and verification code has passed to the general processing program to compare. Frequent verification code error, login failed, but see the text message is sent by the verification code yes. And the service side of the verification code in the session, and found a long time to find the problem. is because if the first time to send a verification code success but did not go to verify, the second person has applied for a verification, resulting in the first verification code is overwritten by the second verification Code, so the first person to verify that can not be verified success.

Solution idea: Put the verification method in the client's JS to verify. Each time the AJAX request to send a verification code of the general handler, send a successful, send the verification code as the return value, in the JS to receive the return value, and finally at each landing time to determine the user input verification code and Ajax return is consistent, if consistent call the login service. This avoids the previous method of verifying code errors that have been reported.

How to avoid comparing verification code errors on the server when logging in

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.