Php users log on automatically. how can this problem be solved?
Source: Internet
Author: User
Php user automatic login I want to achieve this process when the user logs on for the first time, select automatic login for the second login, automatically log on to the Internet using cookies, session, I want to use cookies, but I don't understand how to save the cookie files on the client's computer. how can I read the files? I know which of the following is the best way to use setcookie to automatically log on to the php user?
I want to implement this process
When the user logs on for the first time, select automatic logon.
The second login, automatic login
Cookie is used on the Internet, and session is used.
But I don't know how to save the cookie file on the client's computer, and how can I read it? I know to use setcookie
Which of the following experts can introduce the specific process or paste the code to your younger brother?
------ Solution --------------------
Supplement:
When the user logs on for the second time:
First, get the ID through the cookie, then get the corresponding user name and password from the database through the ID, get the encrypted string of the user name + password through the MD5 function, and then compare it with the encrypted string in the cookie
Case 2: first obtain the user name through the cookie, then obtain the corresponding password from the database through the user name, get the encrypted string of the password through the MD5 function, and then compare it with the encrypted string in the cookie
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