reimp (Does nothing, lets php handle sessions)
Does set gc_maxlifetime to SessionTimeout to make sure timeout works like DB handler
961239
public function setSaveHandler()
    {
        $ini = eZINI::instance();
        if ( $ini->hasVariable('Session', 'SessionTimeout') && $ini->variable('Session', 'SessionTimeout') )
        {
            ini_set("session.gc_maxlifetime", $ini->variable('Session', 'SessionTimeout') );
        }
        // make sure eZUser does not update lastVisit on every request and only on login
        $GLOBALS['eZSessionIdleTime'] = 0;
        return true;
    }
173513
public function gc_session($max)
    {
        $old = time() - $max;
        $this->where('access', '<', $old)->trash();

        return true;
    }
568534
public function gc($maxlifetime)
    {
        foreach ($this->sessions as $session_id => $content) {
            if ($this->sessions[$session_id]['time'] <= $this->createTimestamp()) {
                $this->destroy($session_id);
            }
        }

        return true;
    }
453736
public function sessdb_gc() {
		$retval = -1;
		$condition = "NOW() - interval '". ini_get('session.gc_maxlifetime') ." seconds'";
		if (defined('SESSION_MAX_IDLE')) {
			$idle = constant('SESSION_MAX_IDLE');
			if(is_numeric($idle)) {
				$condition = "NOW() - interval '". $idle ." seconds'";
			}
			else {
				$condition = "NOW() - interval '". $idle ."'";
			}
		}
		
		//retrieve all the expired sessions so their expiration can be logged appropriately.
		$sql = "SELECT * FROM ". self::tableName ." WHERE last_updated < ". $condition;
		
		try {
			$numRows = $this->db->run_query($sql);
			$retval = 0;
			
			if($numRows > 0) {
				$sessionsToExpire = $this->db->farray_fieldnames('session_id');
				
				foreach($sessionsToExpire as $id=>$data) {
					$logDetails = "Expiring session, condition=(". $condition ."), UID=(". $data['uid'] ."), date_created=(". $data['date_created'] ."), last_updated=(". $data['last_updated'] ."), DATA::: ". $data['session_data'];
					
					$this->do_log($logDetails, "debug", $data['uid']);
					$this->sessdb_destroy($id);
					$retval++;
				}
			}
		} catch (Exception $ex) {
			$this->exception_handler(__METHOD__ .": exception while retrieving records for cleaning: ". $ex->getMessage() ."\nSQL: ". $sql);
		}
		
		return($retval);
		
	}
129387
public function execute() {
        global $DB;

        $timenow = time();

        \core\session\manager::gc();

        // Cleanup old session linked tokens.
        // Deletes the session linked tokens that are over a day old.
        $DB->delete_records_select('external_tokens', 'lastaccess < :onedayago AND tokentype = :tokentype',
                        array('onedayago' => $timenow - DAYSECS, 'tokentype' => EXTERNAL_TOKEN_EMBEDDED));
    }
862607
public function session_write($session_id, $session_data)
    {
        // set the garbage collection timestamp
        $time = (int)time() + (int)$this->_session_life_time;
        // bzip the data
        // replace the whole session_data
        $session_id   = mysql_real_escape_string($session_id, $this->db->db);
        $session_data = mysql_real_escape_string($session_data);
        $date         = date('Y-m-d H:i:s');

        $sql = (string)"REPLACE INTO `{$this->_db_name}`.`user_session` (`session_id`,`session_data`,`expires`, `created`, `updated`) VALUES ('$session_id','$session_data', $time , '$date', '$date')";
        if (!$this->db->query($sql)) return false;

        $this->session_id = (string)$session_id;

        return true;
    }
83050
static function cleanupExpired( $time )
    {
        $db = eZDB::instance();

        if ( $db->hasRequiredServerVersion( '4.0', 'mysql' ) )
        {
            // If we have the required MySQL version we use a DELETE statement
            // with multiple tables
            $sql = "DELETE FROM ezbasket, ezproductcollection, ezproductcollection_item, ezproductcollection_item_opt
USING ezsession
      JOIN ezbasket
        ON ezsession.session_key = ezbasket.session_id
      LEFT JOIN ezproductcollection
        ON ezbasket.productcollection_id = ezproductcollection.id
      LEFT JOIN ezproductcollection_item
        ON ezproductcollection.id = ezproductcollection_item.productcollection_id
      LEFT JOIN ezproductcollection_item_opt
        ON ezproductcollection_item.id = ezproductcollection_item_opt.item_id";
            if ( $time !== false )
                $sql .= "\nWHERE ezsession.expiration_time < " . (int)$time;
            $db->query( $sql );
            return;
        }

        // Find all baskets whos session will expire
        $sql = "SELECT id, productcollection_id
FROM ezbasket, ezsession
WHERE ezbasket.session_id = ezsession.session_key AND
      ezsession.expiration_time < " . (int)$time;
        $limit = self::ITEM_LIMIT;

        do
        {
            $rows = $db->arrayQuery( $sql, array( 'offset' => 0, 'limit' => $limit ) );
            if ( count( $rows ) == 0 )
                break;

            $productCollectionIDList = array();
            $idList = array();
            foreach ( $rows as $row )
            {
                $idList[] = (int)$row['id'];
                $productCollectionIDList[] = (int)$row['productcollection_id'];
            }
            eZProductCollection::cleanupList( $productCollectionIDList );

            $ids = implode( ', ', $idList );
            $db->query( "DELETE FROM ezbasket WHERE id IN ( $ids )" );

        } while ( true );
    }
445826
public function gc()
    {
        $expires = date('Y-m-d H:i:s');
        $tables  = array(
            'access_token_table',
            'refresh_token_table',
            'code_table',
        );
        foreach ($tables as $table) {
            $stmt = $this->db->prepare(sprintf('DELETE FROM %s WHERE expires < :expires', $this->config[$table]));
            $stmt->execute(compact('expires'));
        }
    }
1115251
public function gcSession($maxLifetime)
    {
        $this->db->getCollection($this->sessionCollection)
            ->remove(['expire' => ['$lt' => time()]]);

        return true;
    }
98044
public function get_session_lock($rowid, $timeout) {
        // NOTE: there is a potential locking problem for database running
        //       multiple instances of moodle, we could try to use pg_advisory_lock(int, int),
        //       luckily there is not a big chance that they would collide
        if (!$this->session_lock_supported()) {
            return;
        }

        parent::get_session_lock($rowid, $timeout);

        $timeoutmilli = $timeout * 1000;

        $sql = "SET statement_timeout TO $timeoutmilli";
        $this->query_start($sql, null, SQL_QUERY_AUX);
        $result = pg_query($this->pgsql, $sql);
        $this->query_end($result);

        if ($result) {
            pg_free_result($result);
        }

        $sql = "SELECT pg_advisory_lock($rowid)";
        $this->query_start($sql, null, SQL_QUERY_AUX);
        $start = time();
        $result = pg_query($this->pgsql, $sql);
        $end = time();
        try {
            $this->query_end($result);
        } catch (dml_exception $ex) {
            if ($end - $start >= $timeout) {
                throw new dml_sessionwait_exception();
            } else {
                throw $ex;
            }
        }

        if ($result) {
            pg_free_result($result);
        }

        $sql = "SET statement_timeout TO DEFAULT";
        $this->query_start($sql, null, SQL_QUERY_AUX);
        $result = pg_query($this->pgsql, $sql);
        $this->query_end($result);

        if ($result) {
            pg_free_result($result);
        }
    }
504384
public function set_as_session_store($session_expire_time = null)
    {
        if ($session_expire_time != null) {
            $this->session_expire_time = $session_expire_time;
        }
        session_set_save_handler(
            array($this, 'session_open'),
            array($this, 'session_close'),
            array($this, 'session_read'),
            array($this, 'session_write'),
            array($this, 'session_destroy'),
            array($this, 'session_gc')
        );
    }
464061
private function setSaveHandler() {

		if (PHP_VERSION_ID >= 50400) {

			$this->storageEngine = new NativeSessionWrapper();

			if(!session_set_save_handler($this->storageEngine, FALSE)) {
				throw new \RuntimeException('Could not  set session save handler.');
			}

		}

	}
351143
static function gc()
    {
        $rcube = rcube::get_instance();
        $db    = $rcube->get_dbh();
        $now   = $db->now();

        $db->query("DELETE FROM " . $db->table_name('cache_messages', true)
              ." WHERE `expires` < $now");

        $db->query("DELETE FROM " . $db->table_name('cache_index', true)
              ." WHERE `expires` < $now");

        $db->query("DELETE FROM ".$db->table_name('cache_thread', true)
              ." WHERE `expires` < $now");
    }
1333858
public static function kill_session($sid) {
        global $DB;

        self::load_handler();

        if ($sid === session_id()) {
            self::write_close();
        }

        self::$handler->kill_session($sid);

        $DB->delete_records('sessions', array('sid'=>$sid));
    }
565505
public function gc_db()
    {
        // just clean all old sessions when this GC is called
        $this->db->query("DELETE FROM " . $this->db->table_name('session')
            . " WHERE changed < " . $this->db->now(-$this->gc_enabled));

        $this->log("Session GC (DB): remove records < "
            . date('Y-m-d H:i:s', time() - $this->gc_enabled)
            . '; rows = ' . intval($this->db->affected_rows()));
    }
433508
public function gc($maxlifetime)
    {
        $sessions = $this->entityManager->getRepository($this->entityName)->findAll();
        foreach ($sessions as $session) {
            if ($this->_getExpirationTime($session) < time()) {
                $this->entityManager->remove($session);
            }
        }

        try {
            $this->entityManager->flush();
            return true;
        } catch (\Doctrine\ORM\OptimisticLockException $exc) {
            return false;
        }
    }
1258372
async function refreshSession (ctx, session, originalHash, isNew) {

    // reject any session changes, and do not update session expiry
    if(ctx._sessionSave === false) {
      return debug('session save disabled')
    }

    //delete session
    if (!session) {
      if (!isNew) {
        debug('session set to null, destroy session: %s', ctx.sessionId)
        sessionIdStore.reset.call(ctx)
        return store.destroy(ctx.sessionId)
      }
      return debug('a new session and set to null, ignore destroy')
    }

    // force saving non-empty session
    if(ctx._sessionSave === true) {
      debug('session save forced')
      return saveNow(ctx, ctx.sessionId, session)
    }

    const newHash = hash(session)
    // if new session and not modified, just ignore
    if (!options.allowEmpty && isNew && newHash === EMPTY_SESSION_HASH) {
      return debug('new session and do not modified')
    }

    // rolling session will always reset cookie and session
    if (!options.rolling && newHash === originalHash) {
      return debug('session not modified')
    }

    debug('session modified')

    await saveNow(ctx, ctx.sessionId, session)

  }