Ec (2); * & nbsp; Syntax: & nbsp; setcookie (name, value, expire, path, domain, secure) & nbsp; name, cookie name required & nbsp; value, cookie value, required & nbsp; other writeable, however, this function is provided in the following example: time () + 3600*24 & nbsp script ec (2); script
/*
Syntax:
Setcookie (name, value, expire, path, domain, secure)
Name, cookie name required
Value, cookie value, required
Others can be written, but this is a function.
Expire expiration time, for example: time () + 3600*24
Path, for example,/root directory, you can also specify a level-2 directory, for example,/111cn.net/
Domain name, this is the second-level domain name is to be noted, if you let all the second-level domain can access this cookie, It is set like this: ".111cn.net", then, s.111cn.net, down.111cn.net can all access this cookie.
Secure is generally 1
Next, let's look at a cookie instance,
*/
$ Value = 'www .111cn.net ';
Setcookie ('loaddomain ', $ value, time () + 3600*24,'/',' .111cn.net '); // set cookis
// The value of the following cookie is read. in php, the $ _ COOKIE with the cookie name is OK. As follows.
If (isset ($ _ COOKIE ['loaddomain '])
{
$ Cookis = $ _ COOKIE ['loaddomain '];
Header ("location: $ cookis ");
}
// Source www.111cn.net