public SessionInfo copySessionInfoForTreeModel(final SessionInfo sessionInfo) {
    return new SessionInfo(
        sessionInfo.getSessionId(),
        sessionInfo.getUserName(),
        ZoneId.systemDefault(),
        sessionInfo.getVersion(),
        sessionInfo.getDatabaseName().orElse(null),
        IClientSession.SqlDialect.TREE);
  }
must be called after registerSession()) will mark the session login.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/session/SessionManager.java