Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFCOOKIE with CFLOCATION 1

Status
Not open for further replies.

KevinFSI

Programmer
Nov 17, 2000
582
US
The book says that if you have a cookie with a cflocation, the cookie will not be set. Does this mean I cannot have CFCOOKIE anywhere on a page with CFLOCATION and expect it to work? That seems to be the case with this app, but I'm having a hard time believing it.

Kevin
slanek@ssd.fsi.com
 
Yes, these tags are incompatible and cannot be used on the same page. You can think of it this way, a cookie is not set until the entire page's contents are received from the browser. If you have cflocation tag on the page, a header is never returned as one normally would be at the end of a page and so the cookie will never be set. You might want to try using a <cfinclude template=&quot;name.cfm&quot;> tag on this page instead if this alternative would work for you. I use this tag anyway over cflocation whenever possible as it requires less server resources. Hope that helps!
Jami
 
Thanks. I figured that was the case, but couldn't come up with a reason why, so thanks for the enlightenment. Kevin
slanek@ssd.fsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top