The following is the thinkphp framework tutorial column to introduce you to the verification code and session of TP6. I hope it will be helpful to friends in need!
When using the tp6 verification code today, I did the login verification. The verification code reports an error, and life and death prompts that the verification code failed.
In fact, he saved the content of the verification code in the session, so if you use the verification code, you must open the session.
You can see that he first injected a session class into the constructor to create a session object and save it. Later session operations will rely on this object.
First get the verification code information stored in the session.
This is why the session must be enabled when using the tp6 verification code. In the era before tp6, it was based on whether the session was enabled in your php.ini. In tp6, it encapsulates the implementation of session, so you need to manually open the session. Remember! ! !
The above is the detailed content of About TP6 verification code and session. For more information, please follow other related articles on the PHP Chinese website!