I'd like to understand how does domain parameter of setcookie
function works. I've the following code:
setcookie.php:
setcookie("cookie_4", "c4", time()+3600, "", "home_domain.com");
setcookie("cookie_5", "c5", time()+3600, "", "sub2.home_domain.com");
When i make the request form http:\\home_domain.com\setcookie.php
the cookie_4 is available in both http:\\home_domain.com\getcookie.php
and http:\\sub2.home_domain.com\getcookie.php
requests but cookie cookie_5 isn't available from http:\\sub2.home_domain.com\getcookie.php
even if it's explicitly set for domain sub2.home_domain.com?