What is the phone App Verification Code generally placed on the server? Why?

Source: Internet
Author: User
I just want to ask, generally, where are the text message verification codes sent by the server stored, such as session, database, or other places? Why is this design? Thanks. I just want to ask, generally, where are the text message verification codes sent by the server stored, such as session, database, or other places? Why is this design? Thank you.

Reply content:

I just want to ask, generally, where are the text message verification codes sent by the server stored, such as session, database, or other places? Why is this design? Thank you.

I still prefer to put it in redis. After all, access is fast and it can automatically expire.

Session
Cause: You can discard it after verification. Verification code-compliant features
If the session has a server time limit, it will be deleted on time.

Sessions, of course, can be stored in databases and non-relational databases.

First question:

For common functions, we recommend that you setAccess_Token Field, Which can be used to put the following information:

1. Forget the password-retrieve the password verification code from the mailbox;
2. Mobile phone verification code;
3. Other verification information;

This design is simpler and more flexible. The only thing to note is the mutex of the business.

Second question:

By default, sessions are stored as files and can be stored in databases and NoSQL. We recommend that you use Redis because of the high access speed.
Even if it is designed in the futureREST Interface,AppidAnd Access_Token We recommend that you directly store the key information in Redis.

Redis, fast access, and server support.

Personal suggestions for redis

I personally think that the RESTful architecture like APP interfaces should avoid using sessions as much as possible.
In addition, there is not much pressure on this part, and the database can basically be done, And Redis can also be done.

Above.

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.