比如说一个网站同一个目录下有几个互不关联的页面:1.php,2.php,3.php
一个用户访问1.php后生成cookie:
setcookie('mycookie1',$c1);
setcookie('mycookie2',$c2);
setcookie('mycookie3',$c3);
$cc1 = $_COOKIE['mycookie1'];
$cc2 = $_COOKIE['mycookie2'];
$cc3 = $_COOKIE['mycookie3'];
echo $cc1;
echo $cc2;
echo $cc3;
设置 cookie 变量的失效期