Alt etki alanı içinde Çerezler çalışmıyor

0 Cevap

Ben şu kod var:

<?php
$id = $_GET['id'];
$vote = $_GET['vote'];
$month = 2592000 + time();
$cookie = "votez" . $id;
$cookiez = "viewz" . $id;

if(isset($_COOKIE[$cookiez]))        
{
    if(!isset($_COOKIE[$cookie]))        
    {
        setcookie($cookie, "voted", $month, '/', ".mywebsite.co.il");
    }
}
else
{
        setcookie($cookiez, "viewed", $month, '/', ".mywebsite.co.il");
}

>

lets assume that I go to > www.mywebsite.co.il/example.php?id=1&vote=1 on the first time > it will set the first cookie. on the second time > it will set the second cookie. on the third time > nothing will happen

Bu işe nasıl olduğunu.

but if I go to > www.mywebsite.co.il?/example.php?id=1&vote=2 (after I was at www.mywebsite.co.il/example.php?id=1&vote=1) it will set the first cookie again.

if I will go to > www.mywebsite.co.il?/example.php?id=1&vote=3 (after I was at www.mywebsite.co.il/example.php?id=1&vote=1) it will set the first cookie again.

ve böylece ..

ne yani ne olursa olsun oy eşit yapmam gerekiyor, sürece onun aynı kimliği olarak, çerez aynı mı olacak?

(Bu tam kodu değil ve sorunu anlamak için ya da bunu çözmek için tam kod gerekmez).

teşekkürler!.

0 Cevap