yii\mongodb\Session::gcSession PHP Method

gcSession() public method

Do not call this method directly.
public gcSession ( integer $maxLifetime ) : boolean
$maxLifetime integer the number of seconds after which data will be seen as 'garbage' and cleaned up.
return boolean whether session is GCed successfully
    public function gcSession($maxLifetime)
    {
        $this->db->getCollection($this->sessionCollection)->remove(['expire' => ['$lt' => time()]]);
        return true;
    }