if (!function_exists("bcadd")) { include_once dirname(__FILE__) . '/bcadd.php'; } // ************ HANDLERS AND OTHER MODULE LOADERS **************** include_once dirname(__FILE__) . "/loader.php"; include_once dirname(__FILE__) . "/module.php"; // ****************** INITIALIZE SQL CONNECTION ****************** define('DB_ENGINE', 'mysqli'); //----- Create SQL database object if (!defined('SKIP_SQL_INIT')) { $sql = CreateObject('org.freemedsoftware.core.FreemedDb'); } // ********************** START SESSION ************************** if (!defined('SESSION_DISABLE') and !defined('SKIP_SQL_INIT')) { LoadObjectDependency('net.php.pear.HTTP_Session2'); HTTP_Session2::useTransSID(false); HTTP_Session2::useCookies(true); // using an existing MDB2 connection HTTP_Session2::setContainer('MDB2', array('dsn' => $GLOBALS['sql']->GetMDB2Object(), 'table' => 'session')); HTTP_Session2::start(); HTTP_Session2::setExpire(time() + 60 * 60); // set expire to 60 minutes HTTP_Session2::setIdle(time() + 10 * 60); // set idle to 10 minutes if (HTTP_Session2::isExpired()) { syslog(LOG_INFO, "Session expired!!"); HTTP_Session2::destroy(); } if (HTTP_Session2::isIdle()) { syslog(LOG_INFO, "Session became idle"); HTTP_Session2::destroy();