I create a bunch of cookies for authentication purposes and a part of the website allows the users to navigate to the UK part of the site. This is enabled by having a uk prefix in the domain. (e.g uk.domain.com).
I basically have a small script that checks to see if the subdomain is called UK then I deliver the UK content.
How can I make it so all the cookies on domain.com transfer to uk.domain.com?
I've tried ...
... setting the cookie to the just root domain
setcookie("auth", "blahblah", time() + 123, "/", "localhost")
... adding a dot to the beginning of the domain
setcookie("auth", "blahblah", time() + 123, "/", ".localhost")
... creating the cookie on both domains
setcookie("auth", "blahblah", time() + 123, "/", "localhost")
setcookie("auth", "blahblah", time() + 123, "/", "uk.localhost")
... creating cookies without any domain or path.
setcookie("auth", "blahblah", time() + 123, "/")
setcookie("auth", "blahblah", time() + 123)
I just can't seem to get it to work.