Refresh page on page load

Posted on 2011-04-27
Last Modified: 2012-05-11

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.

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)#">
      <CFIF #CGI.HTTP_X_Forwarded_For# EQ "">
            <CFSET ipaddress="#CGI.Remote_Addr#">
            <CFSET ipaddress="#CGI.HTTP_X_Forwarded_For#">

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

Question by:lulu50
    LVL 6

    Accepted Solution

    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.
    LVL 6

    Expert Comment

    also if you are using www or not using www makes a difference when you try it again.

    Author Comment

    yes, I understand thank you cfEngineers:

    Author Closing Comment

    Thank you
    LVL 6

    Expert Comment

    any time

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
    Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now