protected function regenerateCsrfToken()
    {
        $request = Yii::$app->getRequest();
        if ($request->enableCsrfCookie || $this->enableSession) {
            $request->getCsrfToken(true);
        }
    }