AlaK4X
Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64



Your IP : 3.137.221.252


Current Path : /var/www/lhjmq-records.qc.ca/public_html/administration/includes/
Upload File :
Current File : /var/www/lhjmq-records.qc.ca/public_html/administration/includes/cluster_session.php

<?php
/**
 * Copyright (C) 2006 Netsimplify Solutions, Inc.
 */

/**
 * cluster_session_start()
 *
 * This function is needed to prepend cluster node IP address before sessions IDs.
 * It works just like the original session_start(). mod_backhand uses this to find
 * the originating node and pass sessions on. Without this, a shared session
 * directory (ie. NFS mounted /tmp) is needed.
 *
 * IMPORTANT: Don't over-use sessions, this will break fair load-balancing.
 *
 * Ref. http://www.backhand.org/mod_backhand/README.bySession.shtml
 */

/*
function cluster_session_start() {
        session_start();
        $sid = session_id();
        if(strlen($sid) == 32) { // length of a regular ID
                $arr = split("\.", exec("/bin/hostname -i")); // get our primary IP address
                $encstr = "";
                foreach($arr as $number) {
                        $hex = dechex($number);
                        if($number < 16) $encstr .= "0";
                        $encstr .= $hex;
                }
                session_destroy();
                session_id($encstr . $sid);
                session_start();
        }
}
*/

// simon 20171013
function cluster_session_start() {
        session_start();
}

?>