I'm trying to implement a 30 day cookie to store a code related to our
affiliate program. I have this:
$pid = $_GET['PID'];
if (!is_null($pid) ) {
setcookie('PID' ,$pid, time()+60*60*24 *30, "/");
} else $pid = $_COOKIE['PID'];
The idea being, use any PID specified in the URL, overriding any
previous PID set in the cookie. Otherwise, use the cookie PID.
Unfortunately, the cookie never updates. I've tried adding this line
before I set the cookie, but it makes no difference:
setcookie('PID' ,FALSE);
--
Rossz
affiliate program. I have this:
$pid = $_GET['PID'];
if (!is_null($pid) ) {
setcookie('PID' ,$pid, time()+60*60*24 *30, "/");
} else $pid = $_COOKIE['PID'];
The idea being, use any PID specified in the URL, overriding any
previous PID set in the cookie. Otherwise, use the cookie PID.
Unfortunately, the cookie never updates. I've tried adding this line
before I set the cookie, but it makes no difference:
setcookie('PID' ,FALSE);
--
Rossz
Comment