0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CSRF token is invalid

Posted at

起きたこと

EC-CUBEプラグイン作成中に
"CSRF token is invalid"
とのエラーが出て、解消するまで格闘した

基本環境

MacOS Build In Server
php 8.1.29
ECCUBE4.2.3

Form作成中

"CSRF token is invalid"
エラーが起きた

以下、ネットで拾った情報で試す

.twig
{{ form_row(form._token) }}

解消せず

Type.php
/**
 * {@inheritdoc}
 */
public function configureOptions(OptionsResolver $resolver)
{
    $resolver->setRequired('product');
    $resolver->setDefaults([
        'csrf_protection' => false, // この行を追加
        'id_add_product_id' => true,
        'constraints' => [
            // FIXME new Assert\Callback(array($this, 'validate')),
        ],
    ]);
}

解消せず

原因はCache

フォーム作成時に標題のエラーが出る場合、キャッシュが溜まってしまっている可能性がございます。

kintoneのヘルプページ情報なんだけど?

root/var/cache/prod

を削除すると解消!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?