guymclaren Posted September 20, 2008 Share Posted September 20, 2008 Creating of cookie is done on numerous pages. I have tried letting the system create the cookie without adding the url, I tried the following $coid = $_COOKIE["affiliate"]; if ($coid == NULL) { $myid = $_GET['aff']; if ($myid != NULL){ setcookie("affiliate","$myid", time()+5184000,"webtech.co.za"); setcookie("affiliate","$myid", time()+5184000,"www.webtech.co.za"); } } It creates both cookies so in theory it should not matter whether they are using www or not, I also tried .webtech.co.za The problem is the following code on an order page does not read the cookie or give any results. $coid = $_COOKIE["affiliate"]; $aff = $coid; $fname = $_REQUEST['fname']; if ($fname != NULL) { I am tearing my hair out, PHP hates me, but I cannot cope with MIcrosofts bullshit ASP anymore, please help? Quote Link to comment Share on other sites More sharing options...
guymclaren Posted September 20, 2008 Author Share Posted September 20, 2008 Just to add $coid shows a null value despite the existence of the cookie Quote Link to comment Share on other sites More sharing options...
thebadbad Posted September 20, 2008 Share Posted September 20, 2008 You need to set the path too. And use ".webtech.co.za" to make it compatible with more browsers: <?php setcookie('affiliate', "$myid", time() + 5184000, '/', '.webtech.co.za'); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.