Hi, when you set the cookie’s domain, you wrongly strip the subdomain www hence I can’t use cookie free subdomain in my website:
$domain_url = $_SERVER['SERVER_NAME'];
$cookie_domain = str_replace("www","",$domain_url);
setcookie("cart_in_use","true",time()+21600,"/",$cookie_domain); //useful to not serve cached page when using with a caching plugin
Can you please just remove the second line?
It is done intentionally so that the cookie can be valid everywhere in your domain (including sub-domains). This seems to work better for more users out there. So I am not sure if it will be a good idea to remove it which will affect everyone else.