search

Home  >  Q&A  >  body text

php - The project needs to send verification codes and text messages for some verification. How to perform verification?

Project with front-end and back-end separation
Now in the project, verification codes and text messages need to be sent for some verification
The problem is that there are several pages now that have these verifications. For example, you can send text messages to log in, and you also need to send them to register. SMS;
Registration requires a verification code, and other pages may also send verification codes;
The problem is that if the user logs in on two PCs at the same time, Then I applied for text messages on both PC-A and PC-B. At this time, after the user enters the text message, how should I judge which text message should be verified with which text message on the backend?
The same is true for the verification code. How to judge whether the user has sent the text message? Which verification code should the incoming verification code be verified with from the backend?

天蓬老师天蓬老师2794 days ago585

reply all(3)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 13:00:07

    The same account should limit the verification code to only be sent once within the expiration period. Ask your backend to change the logic

    reply
    0
  • PHPz

    PHPz2017-05-16 13:00:07

    Save verification code through session or cookie

    Every device is different

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-16 13:00:07

    1. The last verification code is valid, and subsequent ones will overwrite the original one.

    reply
    0
  • Cancelreply