The general assignment method cookie that is removed in PHP cookies is often used to identify users. A cookie is a small file that the server leaves on the user's computer. Whenever the same computer requests a page through a browser, it also sends a cookie. With PHP, you can create and retrieve the value of a cookie
Grammar
Copy the Code code as follows:
Setcookie (name, value, expire, path, domain);
* *
* Set Cookie
* N name
* C Value
* E validity 0 default one month 1 off immediate failure
/
Function W_cookie ($n, $c, $e = 0, $isde S=1)
{
if ($isdes ==1) {$c =endes ($c, Deskey);}
$exp = time () + 3600 * 24 * 30;
if ($e = = 0)
{
Setcookie ($n, $c, $exp, "/");
}
Else
{
Setcookie ($n, $c, 0, "/");
}
}
//Close Cookie Method
W_cookie (' BB ', ' www.3ppt.com ', $e = 0, $isdes =1);
!--? php function set_cronology ($name, $value, $duration =7) {
$duration =time () + (3600*24* $duration);
$max _stored_values=5;
if (isset ($_cookie[$name])) {
foreach ($_cookie[$name] as $prop _CR
if ($val _CR
return;
}
if ($prop _crono< $max _stored_values)
Setcookie ($name. ' ['. ($prop _crono+1). '] ', $value, $duration);
else{
Array_shift ($_cookie[$name]);
Setcookie ("$name [$max _stored_values]", $value, $duration);
}
}else
Setcookie ($name. ' [0] ', $value, $duration);
return;
}
?>
Note: the Setcookie () function must be located in theLabel before. When a cookie is sent, the value of the cookie is automatically URL-encoded and automatically decoded upon retrieval (to prevent URL encoding, use Setrawcookie () instead).
The above describes the Fortunecookie php cookies to remove the general assignment method, including the fortunecookie aspect of the content, I hope that the PHP tutorial interested in a friend helpful.