What role does User_auth_key play in thinkphp? What are the benefits of having a session in C (' User_auth_key ')? Solutions
Source: Internet
Author: User
What role does User_auth_key play in thinkphp? What are the benefits of having a session in C (' User_auth_key ')?
Is studying thinkphp login detection, login successfully saved Session see two forms, the first kind: session::set (' username ', $_post[' username ');
The second type:
Session::set (C (' User_auth_key '), $username);
The second method needs to write ' user_auth_key ' = ' authId ' in the configuration file,
Could you explain the difference between the two methods? What's the second set of this user_auth_key?
Some say it is to prevent a conflict in the session where the user ID is stored when multiple sets of thinkphp are running under a domain name. But I don't know if it's going to happen. What happens if not, will there be two sessions with the same session ID?
------Solution--------------------
In fact, both are set session only, the latter session of the key is cured in the configuration file, many times just modify the configuration file User_auth_key configuration section below the value can change the session key
------Solution--------------------
I think the main purpose is to use the session encryption.
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