getSessionStore = (pruneInterval) => {
  /*if (getState().getConfig("cookie_sessions", false)) {
    return cookieSession({
      keys: [db.connectObj.session_secret || is.str.generate()],
      maxAge: 30 * 24 * 60 * 60 * 1000,
      sameSite: "strict",
    });
  } else*/
  if (!db.connectObj.session_secret)
    console.warn(
      "WARNING: Session secret not set, degrading functionality. Set session_secret in the config file"
    );
  let sameSite = getState().getConfig("cookie_samesite", "None").toLowerCase();
  if (sameSite === "unset") sameSite = undefined;
  if (db.isSQLite) {
    var SQLiteStore = require("connect-sqlite3")(session);
    return session({
      store: new SQLiteStore({ db: "sessions.sqlite" }),
      secret: db.connectObj.session_secret || is.str.generate(),
      resave: false,
      saveUninitialized: false,
      cookie: { maxAge: 30 * 24 * 60 * 60 * 1000, sameSite }, // 30 days
    });
  } else {
    const pgSession = require("connect-pg-simple")(session);
    return session({
      store: new pgSession({
        schemaName: db.connectObj.default_schema,
        pool: db.pool,
        tableName: "_sc_session",
        pruneSessionInterval: pruneInterval > 0 ? pruneInterval : false,
      }),
      secret: db.connectObj.session_secret || is.str.generate(),
      resave: false,
      saveUninitialized: false,
      cookie: { maxAge: 30 * 24 * 60 * 60 * 1000, sameSite }, // 30 days
    });
  }
}
Gets session store
@returns {session|cookieSession}