G
G
goldwizard132017-05-01 18:21:57
Yii
goldwizard13, 2017-05-01 18:21:57

How to overcome the error The CSRF token could not be verified?

On a site made on yii , I connect a third-party module helpSystem 1.1 and I get an error

2017/05/01 18:08:57 [error] [exception.CHttpException.400] exception 'CHttpException' with message 'The CSRF token could not be verified.' in E:\OpenServer\domains\a24\common\lib\vendor\yiisoft\yii\framework\web\CHttpRequest.php:1247
Stack trace:
#0 E:\OpenServer\domains\a24\common\lib\vendor\yiisoft\yii\framework\base\CComponent.php(561): CHttpRequest->validateCsrfToken(Object(CEvent))
#1 E:\OpenServer\domains\a24\common\lib\vendor\yiisoft\yii\framework\base\CApplication.php(207): CComponent->raiseEvent('onBeginRequest', Object(CEvent))
#2 E:\OpenServer\domains\a24\common\lib\vendor\yiisoft\yii\framework\base\CApplication.php(178): CApplication->onBeginRequest(Object(CEvent))
#3 E:\OpenServer\domains\a24\frontend\www\index.php(62): CApplication->run()
#4 {main}
REQUEST_URI=/helpSystem/dmEditor/imageUpload/upload?CKEditor=TopicForm_body&CKEditorFuncNum=1&langCode=ru
HTTP_REFERER=http://a24/helpSystem/admin/topic/update/id/1/pno/0

If you disable ' enableCsrfValidation' => false in the config, then everything works, but this is not a
solution /topic/index$', '^helpSystem/client/topic/view$', ] in general, how to disable checking for a particular module?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
goldwizard13, 2017-05-01
@goldwizard13

Thanks, I found the solution myself
'noCsrfValidationRoutes' => [
'^helpSystem/.*$',
]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question