Simple solution
setcookie("NAME", "VALUE", time()+3600, '/', EXAMPLE.COM);
Setcookie's 5th parameter determines the (sub)domains that the cookie is available to. Setting it to (EXAMPLE.COM) makes it available to any subdomain (eg: SUBDOMAIN.EXAMPLE.COM )