What is the website Verification Code generally placed on the server? Why? Are the website verification codes of javaphp.net stored in the same place? What is the website Verification Code generally placed on the server? Why? Are website verification codes made by java php. net stored in the same place?
Reply content:
What is the website Verification Code generally placed on the server? Why? Are website verification codes made by java php. net stored in the same place?
Verification CodeWhere on the server? Are languages the same?
First, I am not very familiar with the problem. I try to answer it through my understanding.
Verification Code-> captcha generation, must be inServer
The generated image is stored as an image on the serverA directory
, These files can beGeneration Time
After a fixed period of timeAutomatic deletion
.
I have also seen a fake verification code. The so-called fake verification code is generated and verified by js on the client side, rather than on the server side. Java php. net has a ready-made captcha generation method. You don't need to write it yourself. Just use it and configure the directory, Character Set, and captcha type.
If you have answered your question, please accept it, or click a like.
It usually exists in the session.
Simply put, when a verification code is generated, it is a random string. This variable is stored in the server memory in the form of a session, which corresponds to the session-id of the client, then, use the drawing method such as GDI + to draw an image and then output it to the page. The server does not save the image and only records the string for verification.
Generally, sessions are used. Default temporary files can be used, and sessions can be stored in the database or memory,
- Client Access website
- The server generates the Session tag and returns the Session tag to the client. This is generally achieved by outputting the tag in the Cookie in the response.
- The client carries the Session flag to access the verification code URL.
- The server generates random code and renders the random code into an image output. The Random Code (non-image) is stored in the memory and the data structure is generally a dictionary. You only need to maintain it easily.
- The client carries the Session flag to return the verification code entered by the user.
- The server searches for the previously generated random code in the dictionary based on the Session and compares it with the verification code returned by the client.
Have you seen it? The server does not save the verification code image. It only saves the verification code value in a short time. Because saving images does not make sense to the server, and it increases the IO and storage burden on the server.