Joke Collection Website - Public benefit messages - How does Ann log in with verification code sooner or later?

How does Ann log in with verification code sooner or later?

Sooner or later, Xiao Lai will log in with SMS verification code.

The login process and development steps of using SMS verification code;

1. The user submits the mobile phone number and requests to obtain the SMS verification code.

2. Generate SMS verification code: use the random object to generate the required random 4-digit or 6-digit string, which is the SMS verification code;

3. Store the mobile phone number, verification code and creation time in session, redis or database, and choose one of these three ways.

4. Call the short message platform interface to send the verification code short message to the user's mobile phone.

5. After receiving the short message, the user will backfill the verification code to the login page and submit the login form.

6. Compare whether the submitted verification code is consistent with the verification code in the session, and judge whether the submission action is within the validity period;

7. If the verification code is correct and within the validity period, the request is passed and the corresponding business is processed.