The following code: Three cookies can be generated under chrome and firefox:
cookie[one], cookie[two], cookie[three]
Under IE, only cookie[one], cookie[two] can be generated ] two cookies, the third cookie failed to be generated because ".65.la" was specified.
Copy code The code is as follows:
setcookie("cookie[one]", "cookieone ",time()+36000,"/");
setcookie("cookie[two]", "cookietwo",time()+36000,"/");
setcookie("cookie[three] ", "cookiethree", time()+36000,"/",".65.la");
// Page reset
if (isset($_COOKIE["cookie"])) {
foreach ($_COOKIE["cookie"] as $name => $value) {
$name = htmlspecialchars($name);
$value = htmlspecialchars($value);
echo “$ name : $value
n”;
}
}
?>
After many experiments, it was confirmed that IE thinks “.65.la” This form of domain name parameter is not standardized. If you want the cookie to be common to all subdomains, you can implement it through global variables.
http://www.bkjia.com/PHPjc/324274.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/324274.htmlTechArticleThe following code: three cookies can be generated under chrome and firefox: cookie[one], cookie[two] , cookie[three] Under IE, only two cookies, cookie[one] and cookie[two], can be generated. The third reason...