php COOKIE问题
if (!isset($_COOKIE['referer'])) {
setcookie('referer',$_SERVER['HTTP_REFERER']);
}
从外部链接过来后在站内点击多次,$_COOKIE['referer']的值为变,谁知道原因呢,求解???
------解决方案--------------------你一旦set了一次,isset就为true,大括号就进不去,当然不变
------解决方案--------------------改成这样:
if ($_COOKIE['referer']!=$_SERVER['HTTP_REFERER']) {
setcookie('referer',$_SERVER['HTTP_REFERER']);
}