Laravel多重防护:CSRF令牌不匹配

时间:2019-06-10 06:06:20

标签: laravel

我在laravel中使用了多重防护:

'guards' => [
    'investor' => [
        'driver' => 'session',
        'provider' => 'investors',
    ],

    'initiator' => [
        'driver' => 'session',
        'provider' => 'initiators',
    ],

    'admin' => [
        'driver' => 'session',
        'provider' => 'admins',
    ],

    'api' => [
        'driver' => 'token',
        'provider' => 'investors',
        'hash' => false,
    ],
],

'providers' => [
    'investors' => [
        'driver' => 'eloquent',
        'model' => App\Investor::class,
    ],

    'initiators' => [
        'driver' => 'eloquent',
        'model' => App\Initiator::class,
    ],

    'admins' => [
        'driver' => 'eloquent',
        'model' => App\Admin::class,
    ]
],

这是可行的,但是在一天之后,当用户打开网站并使用guard:investor来检查登录的用户时,用户添加了登录令牌字段,但是当用户想要发送表单时,获得{{1} }

实际上,当会话终止时,用户使用cookie登录,但csrf令牌不匹配。

我的错误是什么?我怎么解决这个问题?

0 个答案:

没有答案