Copy link to clipboard
Copied
I've inherited a ColdFusion site (CF5), despite no background in CF, but have been tasked with making a change to the behavior of the site. I'm running into a problem with cookies, though.
A site on another domain is linking to this site and includes a query string. Now I'm checking for that value (a zip code) in the index.cfm file and storing it in the cookie and that seems to be working fine. I looped through the cookie collection and dumped the results, and the zip code was there. So at this point, all is well.
But then the user clicks on a button, which reloads the index.cfm file with a different <include>
, and the cookie no longer has any values other than CFID and CFTOKEN. This was confirmed by looping through the cookie collection, and later by Fiddler.
Client storage is set to cookie, and I can't find anywhere in the index.cfm, application.cfm, or the included files where the cookie is being set to expire.
Here's the line that's storing the value:
<cfcookie name="ZC_Zip" value="ZC.ZC_Zip#" expires="NEVER">
What else should I be looking for to figure this out?
Copy link to clipboard
Copied
Clicking on the button might be breaking the session. To verify, jot down the values of CFID and CFToken at the point where you loop through the cookie collection. Compare them with the respective values after the button is clicked. What do you get?
Copy link to clipboard
Copied
According to Fiddler, the values for the CFID and CFToken never change.
Copy link to clipboard
Copied
Just as well the values remain the same. Then, at least, session is maintained.
Could it just be that, when the button is clicked, index.cfm is reloaded without the zip-code in the query-string?
Copy link to clipboard
Copied
Andelo13 wrote:
value="ZC.ZC_Zip#"
A typo, surely.
Copy link to clipboard
Copied
BKBK wrote:
Andelo13 wrote:
value="ZC.ZC_Zip#"
A typo, surely.
Correct. I went back to the original file to be sure, and it has value="#ZC.ZC_Zip#". Good eye though.
Copy link to clipboard
Copied
Could it just be that, when the button is clicked, index.cfm is reloaded without the zip-code in the query-string?