我被困在这个问题上的最后两天, 我在我的主“login.php”文件中有以下代码 这是在所有浏览器中运行没有任何问题,但没有在“Safari”中。Safari浏览器不处理cookie - PHP
if(isset($_SESSION["del_log"]) && !empty($_SESSION["del_log"]) && isset($_SESSION["user_type"]) && !empty($deal_type)){
$expire=time()+60*60*24*365;
setcookie("del_log",$_SESSION["del_log"], $expire, '/');
setcookie("user_type", $_SESSION["user_type"], $expire, '/');
echo "<script>window.location.href=\"http://www.sample.com/foldername/index.php\"</script>";
}
我在 “... /文件夹名/ index.php” 包含文件检查这些cookie为:本次发行前
if (isset($_COOKIE["del_log"]) && !empty($_COOKIE["del_log"])){
$log=$_COOKIE["del_log"];
$user_type=$_COOKIE["user_type"];
}else{
echo "<script>window.location.href=\"http://www.sample.com/\"</script>";
}
它设置cookie的,不读或不设置呢? – Voitcus
它不设置cookie ... –