[thelist] CF: CFCookie not sticking?

Sarah Sweeney mr.sanders at designshift.com
Fri Apr 30 07:52:26 CDT 2004


> What is currently occurring is that the cookie does not appear to be 
> laid.  IsDefined("cookie.error_submitted ") always EQ "NO".
> 
> Can anyone suggest where I might be missing the boat?

Frank,

Unless I misunderstand, you are trying to test for the value of the
cookie on the same page where the cookie is set, and you will have no
joy. The cookie is set on the client side, and therefore has not yet
been set when CF is parsing the page on the server side. I'd suggest
setting a session variable at the same time that you set the cookie, and
testing against the session variable. Otherwise, you'll have to use a
meta-refresh or something of the sort to either refresh the page or pass
the user along to a second page where you will be able to successfully
test the value of the cookie. (If you decide to do this, don't use
cflocation, as this will mean the page never gets sent to the user's
browser, and the cookie will never get set.)

HTH,

Sarah




More information about the thelist mailing list