Пример #1
0
 public static function delSession()
 {
     return DB_Session::destroy();
 }
Пример #2
0
    function Destroy($key)
    {
        global $ADODB_SESS_CONN;
        //echo "detroy<br>";
        if ($ADODB_SESS_CONN) {
            $query = "delete from idx_sessions where sesskey = '{$key}'";
            $ADODB_SESS_CONN->Execute($query);
        }
        return true;
    }
    function GC($maxlifetime)
    {
        global $ADODB_SESS_CONN;
        //echo "gc<br>";
        if ($ADODB_SESS_CONN) {
            $query = "delete from idx_sessions where expiry < " . time();
            $ADODB_SESS_CONN->Execute($query);
            $query = "optimize table idx_sessions";
            $ADODB_SESS_CONN->Execute($query);
        }
        return true;
    }
    function Init()
    {
        //echo "init<br>";
        session_module_name('user');
        session_set_save_handler(array('DB_Session', 'Open'), array('DB_Session', 'Close'), array('DB_Session', 'Read'), array('DB_Session', 'Write'), array('DB_Session', 'Destroy'), array('DB_Session', 'GC'));
    }
}
DB_Session::Init();