We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26951
    • 41 Posts
    I am having real problems with closing sessions and running concurrent sessions.

    Basically we want to track all original referring sites and the keywords used, after the user has browsed the site. I am populating eformtodb with INITAL_REFER from here, which works (occasionally!)

    <?php
    session_id();
    $referer = $_SERVER[’HTTP_REFERER’];
    if (!strpos($referer, $_SERVER[’HTTP_HOST’])) {
    $_SESSION[’INITIAL_REFERER’] = $referer;
    }
    ?>


    Problem is the session wont close - I am setting the close to:

    $_SESSION = array();
    // destroy session cookie
    if (isset($_COOKIE[session_name()])) {
    setcookie(session_name(), ’’, time()-42000, ’/’);
    }
    session_destroy();
    $sessionID = md5(date(’d-m-Y H:i:s’));
    session_id($sessionID);
    startCMSSession();
    session_destroy();

    This is called after the user submits a form. It does not seem to work.

    Basically we need to be able to track original referrer, and enable the user to browse the site, and when they leave the site destroy the session. please help!!


      • 29774
      • 386 Posts
      I’ve found this too. I solved it by using unset() on the session var:

      unset($_SESSION[’INITIAL_REFERER’]);
        Snippets: GoogleMap | FileDetails | Related Plugin: SSL