ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Losing My Cookies

November 13, 2008 5:18pm

Subscribe [1]
  • #1 / Nov 13, 2008 5:18pm

    matthew235

    12 posts

    Hi everybody!  I am trying to keep track of which google/yahoo searches brought a user to my page via the $_SERRVER[‘HTTP_REFERRER’] variable. 

    I have these two lines at the beginning of index.php:

    $referrer = $_SERVER["HTTP_REFERER"];
    if (substr($referrer,0,27) != "http://www.airchartertravel")
        setcookie("ac-referrer", $referrer, time()+60*60*24*365*5, "/", ".airchartertravel.com");

    The problem is that my cookie only stays for 5 seconds…. even though i have set it to expire five years from now.  Does anybody have an idea why this might happen or a recommendation for a better way to save referrer data for later use in a form?

  • #2 / Nov 13, 2008 6:58pm

    Greg Aker

    6022 posts

    matthew235:

    Check out the dev docs, specifically the FNS class to see how EE is handling cookies.

    -greg

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases