code: protected function freeze()
      {
          if ($this->getIsActive()) {
              if (isset($_SESSION)) {
                  $this->frozenSessionData = $_SESSION;
              }
              $this->close();
              Yii::info('Session frozen', __METHOD__);
          }
      }
docs: If session is started it's not possible to edit session ini settings. In PHP7.2+ it throws exception.
  This function saves session data to temporary variable and stop session.
  @since 2.0.14