public SessionInfo getSessionInfo(IClientSession session) {
    return new SessionInfo(
        session.getId(),
        session.getUsername(),
        session.getZoneId(),
        session.getClientVersion(),
        session.getDatabaseName(),
        session.getSqlDialect());
  }
must be called after registerSession()) will mark the session login.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/session/SessionManager.java