Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFCookie and domains

Guest
May 14, 2013 May 14, 2013

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

548
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 16, 2013 May 16, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 17, 2013 May 17, 2013
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources