Cookies are stored in a document header. The only way for a cookie to be set on 
a browser is for a document with a cookie in its header to get to the browser. 
CFLOCATION STOPS a document from getting to a browser. It instead says, go 
somewhere else and return NOTHING from the current page. Because it says that, 
a cookie will not be set. Of course, using the CFCOOKIE tag 'forces' a header. 
When this forced header meets with a CFLOCATION, the forced header has to take 
precedence. But CFLOCATION has said that we're not supposed to have any 
document or headers. What's the results? A document contains no data error. 
Wait, I have a complaint. I want my cookies and I want my CFLOCATION. 
ColdFusion must give me both (or I'll cry). Well, rather than use a CFLOCATION 
tag, just use a meta refresh on the page with a time set to 0. This will have 
the result of CF delivering a page to set a cookie and then having the web 
browser do the redirect. A lot less efficient and a lot more prone to network 
problems, but it saves on the tears. Or you could just pass the cookie 
information to the page that's been called by the CFLOCATION. Or any of a dozen 
other techniques that have been talked about for the last 3(?) years.
Once I find a free second to breath I'll add this and other code pieces that 
are related to the CF-Talk FAQ.

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

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to