Exemple #1
0
 public static function destroy($session_id)
 {
     self::$destroyed = true;
     if (!self::db_table_exists('session', true)) {
         $file = _UCM_FOLDER . "/temp/sess_{$session_id}";
         if (file_exists($file)) {
             unlink($file);
         }
         return false;
     }
     $sql = "DELETE FROM `" . _DB_PREFIX . "session` WHERE `session_id` = '" . mysql_real_escape_string($session_id) . "'";
     query($sql);
 }
Exemple #2
0
    // is_installed() does the db_connect above..
}
// storing sessions in a database, only if it's enabled.
// some hosting accounts dont have default session settings that work :-/
//ini_set('error_reporting',E_ALL);
//ini_set('display_errors',true);
if (!session_id() && (!isset($disable_sessions) || !$disable_sessions)) {
    if ($plugins_to_init && is_file('includes/plugin_session/session.php')) {
        $plugin_file_name = 'includes/plugin_session/session.php';
        if (is_file('custom/' . $plugin_file_name)) {
            $plugin_file_name = 'custom/' . $plugin_file_name;
        }
        require_once $plugin_file_name;
        $plugins_to_init[] = 'session';
    }
    if (class_exists('module_session') && module_session::is_db_sessions_enabled()) {
        // don't set file based sessions
        if (_DEBUG_MODE) {
            module_debug::log(array('title' => 'Loading database sessions'));
        }
        new module_session();
    } else {
        if (is_dir(_UCM_FOLDER . "/temp/") && is_writable(_UCM_FOLDER . "/temp/")) {
            // file based sessions in the local /temp/ folder. bad! oh well.
            if (_DEBUG_MODE) {
                module_debug::log(array('title' => 'Loading file based sessions'));
            }
            ini_set("session.save_handler", "files");
            session_save_path(_UCM_FOLDER . "/temp/");
        }
    }