Closed PELock closed 3 years ago
I give up... still ton of unable to verify the submission errors, so it's not secure
nor csrfParam
name issue.
What more can I do to find the reason behind this?
Well, no, by default it's
_csrf
and changing it should not affect the normal behavior but... since it looks like we tried everything we could think of trying to fix the problem, we can try this as well. Let us know @PELock
did you specify seperate path for your backend and frontend part?
i think because your app hase 2 part ( frontend and backend ) you should set path for each one .
try to add path for each one. the base path that u can access it.
@nareka88
Hmm, I have noticed something.
The official advanced theme from 2.0.13 has this thing in headers
https://github.com/yiisoft/yii2-app-advanced/blob/master/frontend/views/layouts/main.php
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php $this->registerCsrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
</head>
but I'm using the old template from some older advanced theme and it looks like this:
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="referrer" content="<?php if (empty($this->params["referrer"])) { ?>unsafe-url<?php } else { ?><?= $this->params["referrer"] ?><?php } ?>">
<?= Html::csrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<link rel="preconnect" href="https://translate.google.com" crossorigin>
<link rel="preconnect" href="https://fonts.googleapis.com" crossorigin>
<link rel="preload" href="/css/bootstrap/fonts/icomoon.ttf?wkc5aa" as="font" as="font" type="font/ttf" crossorigin>
<link rel="alternate" hreflang="x-default" href="<?= BaseUrl::to($mirrorLinks['en'], true) ?>">
<link rel="alternate" hreflang="en" href="<?= BaseUrl::to($mirrorLinks['en'], true) ?>">
<link rel="alternate" hreflang="pl" href="<?= BaseUrl::to($mirrorLinks['pl'], true) ?>">
<link rel="icon" href="/img/favicons/<?php if (YII_ENV_PROD) { ?>favicon.ico<?php } else { ?>favicon-green.ico<?php } ?>">
<link rel="apple-touch-icon" href="/img/apple-touch-icon.png">
<link rel="apple-touch-icon-precomposed" href="/img/favicons/apple-touch-icon-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="/img/favicons/apple-touch-icon-120x120-precomposed.png">
<script type="text/javascript">window.$crisp=[];window.CRISP_WEBSITE_ID="022e663c-63c0-43f9-aea2-2d2215e75e4a";(function(){d=document;s=d.createElement("script");s.src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script>
<?php $this->head() ?>
I will try to replace
<?= Html::csrfMetaTags() ?>
with
<?php $this->registerCsrfMetaTags() ?>
and let you know.
Nah, still errors.
Well, no, by default it's
_csrf
and changing it should not affect the normal behavior but... since it looks like we tried everything we could think of trying to fix the problem, we can try this as well. Let us know @PELockdid you specify seperate path for your backend and frontend part?
i think because your app hase 2 part ( frontend and backend ) you should set path for each one .
try to add path for each one. the base path that u can access it.
@nareka88
I don't experience any problems in my backend and the path you set in your configuration is the default value anyway:
https://www.yiiframework.com/doc/api/2.0/yii-web-cookie#$path-detail
So it's not a solution to this problem.
I think it could be some kind of cookie blocking on the user side, but I'm not sure why or when.
What steps will reproduce the problem?
I got tons of
yii\web\BadRequestHttpException: Unable to verify your data submission
in my logs since the latest updates, what is going on?Additional info
The exception is thrown at:
My config:
But why now, after the update??? I know Chrome 88 rolled out, but is it related?
I'm looking at the logs right now, check this out:
The cookies array is empty... But in other entries it's not: