Sharing cookies among all subdomains
As explained earlier, cookies are not shared among subdomains or between the domain and the subdomain. In order to set cookies accessible by all subdomains, use the following techniques:
1. While writing the cookie, set the cookie domain to ".domain.ext" so that it applies to all subdomains.
2. If the cookie domain is set to ".domain.ext", it will not be accessible by a user who types in the address without the www before the domain (i.e.
http://domain.ext). Therefore, redirect all requests without www to
http://www.domain.ext.
There are some reported problems with the above approach. It is safe to set the default cookie with no domain specified and then set another one with domain as ".domain.ext". In this case there is no need for the redirects. However, remember that session cookies are set by the web server software and you may not have control over how the cookie domain is set.
hope that helps