We are in some of the message book, BBS discussion area post often this phenomenon: when entering the Post interface in the request to fill in the user name and password where it has been automatically filled with your information. What the hell is going on here? This is because of the introduction of cookie technology in the program. It turns out that the first time you log in, the program has installed a cookie packet on your computer, and the computer automatically retrieves your cookie and takes out the information for the program to call when you log in later, so the phenomenon described above appears.
A
Cookie is simply a message packet that a CGI program requires a browser to hold, and this packet can be retracted by the CGI program at any time. Whenever a CGI program requires a cookie to be created, the cookie can be transferred from the server to the subdirectory that the browser belongs to (typically the directory stored in the C:\WINDOWS\Temporary Internet files, which is called a cookie installation. The installation and readout of the
cookie is usually done by a CGI module, and I will publish the original code of this module to everyone, and with this cookie module we can say that it is easy to apply cookie technology when writing a program. The syntax of the
Cookie:
The HTTP cookie is sent over the HTTP header, and he is earlier than the file, with the syntax of the header Set-cookie as follows:
Set-cookie:name=name; Expires=date;path=path;domain=domain;secure Name=name: You need to set the value of the cookie (name cannot use ";" and ","), with multiple name values separated by ";" For example: name1= name1; Name2=name2;name3=name3.
Expires=date:cookie Expiration date, format: expires= "wdy,dd-mon-yyyy HH:MM:SS"  
Path=path: Sets the path supported by the cookie if path is a path , the cookie takes effect on all files and subdirectories in this directory, for example: Path= "/cgi-bin/", if path is a file, the cookie refers to the file, for example: Path= "/cgi-bin/cookie.cgi".
Domain=domain: The domain name that is valid for the cookie, for example: domain= "Gzdzw.51.net"
Secure: If this flag is given, the cookie can only be passed through the HTTPS server of the SSL protocol. The receipt of the
cookie is implemented by setting the environment variable Http_cookie, which can be retrieved by the CGI program for cookie information.