I'm trying to pass some info within subid's to the tracking platform of the network. This is where I set the cookie (in the header, before any output):
So far no problem with this part, the cookie gets set in the browser, I verified that.
Now this is what I have in my redirect file:
The problem is that always the "whatever" subid gets passed. Looks like the part with the isset-if-clause causes the problem. Maybe I'm blind but I really can't come up with a solution to this atm :hollering:
Any help is appreciated!
PHP:
<?php
if( !isset($_COOKIE['sid']) )
{
$some = 'hurr';
$dynamic = 'durr';
$variables = 'hurr';
$subid = base64_encode($some.",".$dynamic.",".$variables);
setcookie("sid", $subid);
}
?>
Now this is what I have in my redirect file:
PHP:
<?php
if (isset($_COOKIE['sid'])) {
$url = 'http://network.com/track.php?mer=54&affid=82&subid='.$_COOKIE['sid'];
} else {
$url = 'http://network.com/track.php?mer=54&affid=82&subid=whatever';
}
header('location: '.$url);
?>
Any help is appreciated!