> I know this has come up before; poked around the archives a bit; but what
> was there didn't help me.
>
> I'm trying to, from a page on one domain, to set a cookie that a page on
> ANOTHER domain can read. I've tried all sorts of combos of CFCOOKIE, using
> the "DOMAIN='domain.com'", setting "domain" as the name and the domain
> itself as the value, and even doing it with straight-up
> Javascript, but the
> page on the second domain that I have set up, reading in "document.cookie"
> in JS just isn't finding a thing.

Easy solution to this;

Make a template that is used as a graphic, then call it on the page - it
should CFContent a 1x1 transparent GIF (43 bytes) and also write a cookie to
the domain...

<img src="http://www.myDomain.com/image.cfm/12345/image.gif" height=1
width=1>

<!--- image.cfm --->
<cfset c=CGI.path_info>
<cfif c is "">
        <cfset c=CGI.script_name>
</cfif>
<cfset cid=ListGetAt(c,2,"/")>
<cfcookie name="ID" value="#cid#" expires="never">
<cfcontent type="image/gif" file="c:\blank.gif" reset="yes">


It's rough code (written without testing and off the top of my head), but it
should do what you want...

Reasons why I put the "image.gif" on the end of the image name - older
browsers don't display "images" that aren't a real image type, therefore a
file not ending with .GIF, .JPG or .JPEG will appear as a broken graphic -
putting the fake image name on the end gets around this...

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to