Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Losing cookie data

New Here ,
Jun 04, 2014 Jun 04, 2014

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?

220
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2014 Jun 04, 2014

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 04, 2014 Jun 04, 2014

According to Fiddler, the values for the CFID and CFToken never change.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2014 Jun 04, 2014

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2014 Jun 04, 2014

Andelo13 wrote:

     value="ZC.ZC_Zip#"

A typo, surely.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 04, 2014 Jun 04, 2014

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2014 Jun 04, 2014
LATEST

Could it just be that, when the button is clicked, index.cfm is reloaded without the zip-code in the query-string?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources