I am trying to set a cookie from "example.com" so that it's only accessible to 'site.example.com'. The problem is that this does not work for some reason. For example, the code below works correctly:
setcookie('my_var', "hello", time()+3600, "/", 'example.com');
That is, when ran from example.com, then I can see the 'my_var' cookie from the site.example.com. However, the code below does not set the cookie:
setcookie('my_var', "hello", time()+3600, "/", 'site.example.com');
(neither does if I prepend a dot, like '.site.example.com')
Using php 5.3.8 and chromium