Hot answers tagged

2

Try to disable the CSRF protection by event use Yii; use yii\base\ActionEvent; use yii\base\Event; use yii\web\Controller; Event::on(Controller::class, Controller::EVENT_BEFORE_ACTION, function (ActionEvent $actionEvent) { if ($actionEvent->action->id == 'update-cart') { Yii::$app->controller->enableCsrfValidation = false; } });


1

The CSRF token is likely expiring. Since pages are cached with Blitz, you must use some strategy to ensure that a fresh CSRF token is loaded into the page on each page that is statically served. The simplest way to do this is to use the Dynamic Content feature in Blitz, specifically craft.blitz.csrfInput(). <form method="post"> {{ craft....


1

Try to disable the CSRF protection by event use Yii; use yii\base\ActionEvent; use yii\base\Event; use yii\web\Controller; Event::on(Controller::class, Controller::EVENT_BEFORE_ACTION, function (ActionEvent $actionEvent) { if ($actionEvent->action->id == 'facebook') { Yii::$app->controller->enableCsrfValidation = false; } });


Only top voted, non community-wiki answers of a minimum length are eligible