Copy link to clipboard
Copied
My cfcookies are only good for "domain.com" and if a user goes to "www.domain.com" the cookie is not valid. Any ideas on how I can make the cookie valid for the entire domain?
I have entered the domain as ".domain.com" in the cfcookie tag. Coldfusion version is 8.
Thanks!
Mike
Copy link to clipboard
Copied
It may de interpreted that domain.com and www.domain.com are different. Leave out the domain attribute. Then Coldfusion will set the cookie in the current domain, whatever that is. You could alternatively, and as a last resort, use Javascipt to set the cookie.
Copy link to clipboard
Copied
Thanks for the input BKBK...you are exactly right, it was interpreting the domain and www.domain differently. The cfcookie has been setting for years with no domain attribute and suddenly this problem came up.
I have tried it with and without the domain attr and it still will not include the "www" inside the domain like it should.
I solved the problem (so far so good at least) with a url redirect that sends all www requests to the regular domain name.
~Mike