• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

Refresh page on page load

Hi,

I am not sure why my code are not read when the user visit my page but if I refresh the page
I can see that it is going thru the code.
HHHmmmm

for example I said if the cookie exist then go to the home page. but for some reason it will only go to the home page if I refresh the page. the cookie is there so it should automatically go to the home page.


<cfif IsDefined("cookie.GetIPUser")>
  <cflocation url="home.html?ChID=#listlast(cookie.GetIPUser)#">
<cfelse>
      <CFIF #CGI.HTTP_X_Forwarded_For# EQ "">
            <CFSET ipaddress="#CGI.Remote_Addr#">
      <CFELSE>
            <CFSET ipaddress="#CGI.HTTP_X_Forwarded_For#">
      </CFIF>

  <CFQUERY DATASOURCE="xxx" NAME="GetIPADD">
     Select distinct IPAddress, ChurchID FROM xx where IPAddress = '#ipaddress#'
  </CFQUERY>
  <cfif GetIPADD.RecordCount neq 0>
  <cflocation url="home.html?ChID=#GetIPADD.ChurchID#">
  <cfelse>
    <cfcookie name="GetIPUser" value="#ipaddress#" expires="30">
  </cfif>

</cfif>
0
lulu50
Asked:
lulu50
  • 3
  • 2
1 Solution
 
cfEngineersCommented:
This could be a cache issue
try appending something on the url like ?test=1
or &test=1 depending on how many params you have in the query_string.
0
 
cfEngineersCommented:
also if you are using www or not using www makes a difference when you try it again.
0
 
lulu50Author Commented:
yes, I understand thank you cfEngineers:
0
 
lulu50Author Commented:
Thank you
0
 
cfEngineersCommented:
any time
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now