Laravel 5.1 中 VerifyCsrfToken.php 第 53 行中的 TokenMis
问题描述
当我尝试登录时显示令牌错误.我在视图中检查了令牌是正确的,当评论 AppHttpMiddlewareVerifyCsrfToken::class
时,在 Kernel.php
它让我登录,但重定向到我的仪表板后我没有登录.我在 mac 上使用 MAMP.
同时我使用Sentry Package
登录.
已
由于您使用的是表单构建器,因此请从表单中删除它.当您执行 Form::open()
所以删除这一行:
When I try to login show me token error. I have checked token in view form it's right and when comment AppHttpMiddlewareVerifyCsrfToken::class
,
in the Kernel.php
it makes me login but after Redirect to my dashboard I'm not logged in. I am using MAMP on mac.
Meanwhile I use Sentry Package
for login.
Edited:
Since you are using Form builder remove this from your form. Laravel form builder automatically adds a hidden token field to your form when you do Form::open()
So remove this line:
这篇关于Laravel 5.1 中 VerifyCsrfToken.php 第 53 行中的 TokenMismatchException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!