In non-https situations, token is usually a string of codes obtained by encrypting the user's information. For example, simple: token = md5(username+password), then when we communicate with the server, we will pass the token and username to the server. After the server gets the username, it will query the corresponding password from the database. Then use md5(username+password) to compare with the password passed by the client. The token is usually returned to the client by the server when logging in. The client retains the token, which means that the login status of the app is maintained.
It’s nothing more than assigning a unique identifier to each user, what you said
The username, password, and a lot of information are used, which results in a very long token length. And at this time, the token already contains key information such as username and password
There is no need to think about this issue at all. Because you can completely use the base64 obfuscated string after userId+timestamp as your token. In this way, the token will not be very long, and there is no fear of being intercepted during intermediate transmission.
In non-https situations, token is usually a string of codes obtained by encrypting the user's information. For example, simple: token = md5(username+password), then when we communicate with the server, we will pass the token and username to the server. After the server gets the username, it will query the corresponding password from the database. Then use md5(username+password) to compare with the password passed by the client. The token is usually returned to the client by the server when logging in. The client retains the token, which means that the login status of the app is maintained.
It’s nothing more than assigning a unique identifier to each user, what you said
There is no need to think about this issue at all. Because you can completely use the base64 obfuscated string after userId+timestamp as your token. In this way, the token will not be very long, and there is no fear of being intercepted during intermediate transmission.