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? Link to comment https://forums.phpfreaks.com/topic/125067-cookies-not-being-read/ 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 Link to comment https://forums.phpfreaks.com/topic/125067-cookies-not-being-read/#findComment-646341 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'); ?> Link to comment https://forums.phpfreaks.com/topic/125067-cookies-not-being-read/#findComment-646350 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.