code: public function init()
      {
          parent::init();
          register_shutdown_function([$this, 'close']);
          if ($this->getIsActive()) {
              Yii::warning('Session is already started', __METHOD__);
              $this->updateFlashCounters();
          }
      }
docs: Initializes the application component.
  This method is required by IApplicationComponent and is invoked by application.