code: public function close()
      {
          if ($this->getIsActive()) {
              // prepare writeCallback fields before session closes
              $this->fields = $this->composeFields();
              YII_DEBUG ? session_write_close() : @session_write_close();
          }
      }
docs: Ends the current session and store session data.
  @since 2.0.17