cookie vil ikke opdatere
jeg har prøvet på at lave en der opatere mine cookies men lige meget hvad jeg prøver så kan jeg ikke få den til at virke. der sker simpelhen ikke en skid. min opret cookie og slet cookie virker fint.function makeCookie(){
$host = explode(".", $_SERVER["HTTP_HOST"]);
$host = ".".$host[1].".".$host[2];
setcookie("BDBcook[tema]","Egmont", time() + (60*60*24*356), "/", $host);
setcookie("BDBcook[sprog]","dk", time() + (60*60*24*356), "/", $host);
setcookie("BDBcook[apl]","4", time() + (60*60*24*356), "/", $host);
setcookie("BDBcook[subm]","1", time() + (60*60*24*356), "/", $host);
setcookie("BDBcook[visn]","blok", time() + (60*60*24*356), "/", $host);
setcookie("BDBcook[aps]","16", time() + (60*60*24*356), "/", $host);
$count = 0;
foreach($_GET as $i => $v){
if($count == 0){
$og = "";
}else{
$og = "&";
}
$sti .= $og.$i."=".$v;
$count++;
}
if($sti == ""){
header("Location: index.php?rand=".time());
exit;
}else{
header("Location: index.php?".$sti."&rand=".time());
}
}
function sletCookie(){
$host = explode(".", $_SERVER["HTTP_HOST"]);
$host = ".".$host[1].".".$host[2];
setcookie("BDBcook[tema]","", time() - (60*60*24*356), "/", $host);
setcookie("BDBcook[sprog]","", time() - (60*60*24*356), "/", $host);
setcookie("BDBcook[apl]","", time() - (60*60*24*356), "/", $host);
setcookie("BDBcook[subm]","", time() - (60*60*24*356), "/", $host);
setcookie("BDBcook[visn]","", time() - (60*60*24*356), "/", $host);
setcookie("BDBcook[aps]","", time() - (60*60*24*356), "/", $host);
}
function retCookie($tema, $sprog, $apl, $subm, $visn, $aps){
$host = explode(".", $_SERVER["HTTP_HOST"]);
$host = ".".$host[1].".".$host[2];
if($tema == ""){
$tema = $_COOKIE["BDBcook"]["tema"];
}
if($sprog == ""){
$sprog = $_COOKIE["BDBcook"]["sprog"];
}
if($apl == ""){
//if($apl <= 10){
$apl = $_COOKIE["BDBcook"]["apl"];
}
if($subm == ""){
$subm = $_COOKIE["BDBcook"]["subm"];
}
if($visn == ""){
$visn = $_COOKIE["BDBcook"]["visn"];
}
if($aps == ""){
//if($aps <= ($_COOKIE["BDBcook"]["apl"] * 3) + ($_COOKIE["BDBcook"]["apl"] *3)){
$aps = $_COOKIE["BDBcook"]["aps"];
}
$tema = "sfgsgsdg";
unset($_GET["tema"], $_GET["sprog"], $_GET["apl"], $_GET["subm"], $_GET["visn"], $_GET["aps"], $_COOKIE["BDBcook"]);
//sletCookie();
setcookie("BDBcook[tema]", $tema, time() - (60*60*24*356), "/", $host);
setcookie("BDBcook[sprog]", $sprog, time() - (60*60*24*356), "/", $host);
setcookie("BDBcook[apl]", $apl, time() - (60*60*24*356), "/", $host);
setcookie("BDBcook[subm]", $subm, time() - (60*60*24*356), "/", $host);
setcookie("BDBcook[visn]", $visn, time() - (60*60*24*356), "/", $host);
setcookie("BDBcook[aps]", $aps, time() - (60*60*24*356), "/", $host);
$count = 0;
foreach($_GET as $i => $v){
if($count == 0){
$og = "";
}else{
$og = "&";
}
$sti .= $og.$i."=".$v;
$count++;
}
if($sti == ""){
header("Location: index.php?rand=".time());
exit;
}else{
header("Location: index.php?".$sti."&rand=".time());
}
}