Phpcookie question ??? The website has such an automatic login function. I also want to find the cookie on the Internet, but I still don't understand it in several aspects, could you kindly advise me? the younger brother thanked me first. 1: I have a session on my website, which stores the user id. I wanted to create a hidden form, when a user logs on, the user submits the id, user name, and password information, and then determines whether a cookie exists. If no cookie exists, the data is written. But is the php cookie problem ???
The website has such an automatic login function. I also want to find the cookie on the Internet, but I still don't understand it in several aspects, thank you for your advice;
1: My website has a session, which stores the user id. I originally wanted to make a hidden form. when the user logs on, I submitted the id, user name, and password information, then determine whether there is a cookie and write it if there is no cookie. but then I thought about it. if there is only a user name and password, I can still query the id. Is there any need to get another one ???
2: I looked at the cookies on other websites, which seem to have been encrypted and I don't understand them, so I am struggling. For example, if md5 () is used for encryption, the password database is actually md5 (). What about the user name ?? How can I check whether it is correct ?? Md5 () does not seem to support reverse decryption, right ???
3: do I usually use two cookies to save the user name and password ?? Is it saved in a file ??
Please let me know in detail. The younger brother is a little white in this regard. it is best to say that you usually write a process similar to this "automatic login", so that the younger brother can have a thought. thank you again.
------ Solution --------------------
The so-called "automatic login" means that you have logged on.
PassDo not log on again
This indicates that historical logon information is stored in the cookie. the cookie has an expiration time. any content that does not exceed the expiration time will be transmitted to the web server along with the http request.
If the website allows "automatic logon", you must first determine whether this information exists in $ _ COOKIE.
Only one cookie is generated for a website in the browser. whether or not the cookie is retained depends on the Expiration Time.
Cookies are always transmitted in plain text (although it may be the so-called "ciphertext") over the network.
The content stored on the Internet is shown to people. if you don't want to show it to people, do not put it on the website.
------ Solution --------------------
There are a lot of automatic login practices. when the security is guaranteed, the performance is fine.
1. the general SESSION mechanism only sets a longer SESSION retention period and a longer session cookie life period.
2. a custom COOKIE that cannot be reversed is actually a signature. Can the server record the COOKIE properly? database or file? Random. The server should make the program logic ready. after detecting the COOKIE automatically for the first time, the server should replace it with a SESSION with a short life cycle for ease of use.