When setting a cookie, it gets the current domain and path as default parameter.
The problem there is, that the cookie won't be available in a subdomain. To be
able to access it on the subdomain, you need to set the domain and path
explicitly:
document.cookie = "