> > When I tried just setting a cookie for another domain, CFCOOKIE
> > threw an error:
> >
> > "Error Occurred While Processing Request
> > Error Diagnostic Information
> > Error attempting to set a cookie value with CFCOOKIE.
> > Invalid CFCOOKIE DOMAIN attribute"
>
> The only time I get that error is if I don't include a leading dot.
> When I was trying to set it for a different domain, WITH the leading
> dot, I didn't get an error, but the cookie isn't set.

I got the error using the dot to set the DOMAIN attribute to a different
domain.

> The problem with the leading dot is, it's impossible to set a cookie
> that will work with and without a subdomain. It can only be set so
> all subdomains will work. In other words, if I'm on a page:
>
> http://domain.com
>
> Then I can use cfcookie without setting the domain and it will be
> good for http://domain.com, but won't work with www.domain.com, etc.,
> or I can set a cookie WITH a domain attribute as cfcookie
> domain=".domain.com", with the leading dot, which will be good for
> www.domain.com or secure.domain.com etc., but won't work on plain old
> domain.com because http://domain.com doesn't have a dot in front of
> it.

You can do this:

<cfcookie name="foo" value="myval" domain=".mydomain.com;mydomain.com">

It worked for me.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to