I apologize for posting this again, but alas, my first post didn't get any replies 
(which surprises me from this group). Can anyone possibly help me?

I've run this past our internal CFTalk like list and nobody has come up with an answer 
either. Now I realize that cfcookie is client side code and everyone tells me that I 
shouldn't be experiencing the problem that I am... Yet I AM having this problem and 
many others have verified that this chunk of code is indeed forcing the page to 
refresh, yet nobody can explain why.

My thanks to all for supporting the people on this list (I've been lurking on and off 
for a year or two).

Mitch

-----Original Message-----
From: Aunger, Mitch 
Sent: Wednesday, September 17, 2003 1:51 PM
To: CF-Talk
Subject: cfcookie and browser back button - causes page refresh - help?


Hi y'all
 
I have a new issue that has me stumped. Maybe if i talk it out, someone will know the 
answer.
 
I have a CFMX include (tho the same thing probably happens in a CF5 environment tho i 
haven't gone back and tested it) that i'm using to create a popcorn trail at the top 
of all the pages in my site. We opted to use cookies to do this (yes, there are a 
million other ways)... and i've recently discovered this is causing a problem.
 
There is something in the code shown at the bottom of this note that is causing my 
problem. If I leave the code uncommented, the code executes and cookies are properly 
created -- yet if i use the browser back key on any page, the previous page (which 
also executes the same code) re-executes - even tho the traditional back button action 
is to just display the page as it was. The real problem occurs when the previous page 
was a form - the refresh forces all of the user entered data to be lost and I don't 
want that to happen!
 
If I comment out the code, everything works ok (tho the popcorn trail obviously isn't 
created) - but the back button in the browser does NOT cause the page to refresh 
automatically.
 
Does anyone know WHY this code would cause the browser to force a page refresh in both 
IE5.5 and NS 4.73?????? (Stuck there due to work requirements - can't go to newer 
browsers - sorry I can't share a link with the group - 'tiz inside a firewall) 
 
Here's the code that seems to be the problem:
 
cfif get_page.menuLevel eq 1>
  <!--- If cookie 1 already exists - delete and set new --->
    <cfif isdefined("cookie."&#site.siteName#&"cookie1")>
   <!--- If the cookie1 is already defined, delete and create new --->
   <!--- Delete Old! --->
   <cfcookie name="#site.siteName#cookie1" 
    value="<a href='index.cfm?#cgi.QUERY_STRING#'><font 
color='ffffff'>#get_page.menuTitle#</font></a>" 
    expires="NOW">
   <!--- Create New! --->
   <cfcookie name="#site.siteName#cookie1" 
    value="<a href='index.cfm?#cgi.QUERY_STRING#'><font 
color='ffffff'>#get_page.menuTitle#</font></a>" 
    expires="1">
   <!--- If a new cookie1 is being set, and cookie2 exists, delete cookie2 --->
   <cfif isdefined("cookie."&#site.siteName#&"cookie2")>
    <!--- Delte Old! --->
    <cfcookie name="#site.siteName#cookie2" 
     value="<a href='index.cfm?#cgi.QUERY_STRING#'><font 
color='ffffff'>#get_page.menuTitle#</font></a>" 
     expires="NOW">
   </cfif>
  <!--- If cookie1 does not exist - create --->
  <cfelse>
   <!--- Set the cookie! --->
   <cfcookie name="#site.siteName#cookie1" 
    value="<a href='index.cfm?#cgi.QUERY_STRING#'><font 
color='ffffff'>#get_page.menuTitle#</font></a>" 
    expires="1">
  </cfif>
 <cfelse>
  <cfif isDefined("URL.debug")> not level 1<br></cfif>
 </cfif> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137804
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

Reply via email to