- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我很惭愧问这个问题,因为这个问题已经被其他人问过很多次了,但是我自己找不到任何解决办法。
我正在使用 Laravel 5.3,我根据文档和其他 stackoverflow 主题创建了一个简单的表单。
在我的本地机器上一切正常。将我的项目放在服务器上后,在我提交表单后这个错误不断出现:
TokenMismatchException in VerifyCsrfToken.php line 68:
在 head
部分添加了 CSRF token :
<head>
<meta name="csrf-token" content="{{ csrf_token() }}" />
</head>
表单还包含csrf:
<form method="POST" action="/save_new_order">
{{ csrf_field() }}
<input type="text" name="web_name">
<textarea cols="30" rows="15" name="web_description"></textarea>
<input type="email" name="web_email">
<input type="submit" id="submitButton" value="WYŚLIJ" name="submit">
</form>
我也试过使用:
<input type="hidden" name="_token" value="{{ csrf_token() }}">
代替:
{{ csrf_field() }}
每次我使用表单时, token 都会保存在 storage/framework/sessions/中。
请帮我解决这个问题,我已经工作了 15 个多小时,但到目前为止什么都没做。
最佳答案
我的 .env
文件中有不可见的 BOM 字符。
我在我的 notepad++ 中将它转换为 utf8-without-BOM,现在它可以工作了。
关于php - Laravel 5.3 形式的 TokenMismatchException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41515262/
当上传一张图片时,laravel 会仔细检查所有事情。没有戏剧。一旦我上传视频文件,不。弹出:. TokenMismatchException in VerifyCsrfToken.php line
我正在使用资源组并使用此过滤器来解决 TokenMismatchException 问题: Route::filter('csrf', function($route, $request) {
如果文件符合此验证规则,我可以上传文件 'user_file' => 'file|max:10240|mimes:xls,xlsx,doc,docx,pdf,zip' 一切顺利 我在 php.ini
我在 Laravel 5 中遇到随机 TokenMismatchExceptions。在 tokensMatch() 函数中使用以下代码我一直在尝试调试这个奇怪的问题: Log::debug($req
可以使用 try catch block 捕获 TokenMismatchException 吗?我希望它显示实际页面并仅显示错误消息,而不是显示显示“VerifyCsrfToken.php 第 46
可以使用 try catch block 捕获 TokenMismatchException 吗?我希望它显示实际页面并仅显示错误消息,而不是显示显示“VerifyCsrfToken.php 第 46
当我上传低于 8MB 时,它工作正常。但是当文件超过 8 MB 时会显示此错误 (1/1) TokenMismatchException in VerifyCsrfToken.php (line 68
我的 Javascript 按钮上批准评论时似乎遇到了 TokenMismatchException 问题。我从类似的按钮系统复制了代码,并对其进行了更改以满足该系统的要求。我正在重用 Session
我正在正常处理我的项目,当我点击刷新以查看我刚刚在其中一个 html 页面中所做的更改时,该页面在左上角显示了一个文本“重定向到:http://localhost:8888/xxx”。它将我重定向到登
我需要了解为什么 post 请求会引发 TokenMismatchException。我还尝试过添加标准解决方案 和 headers: {'X-CSRF-Token': $('meta[name=c
我正在尝试通过 dropzone 上传图片,但即使我在需要的地方添加了 csrf token ,我也收到 token 不匹配错误,我变得非常绝望...... 我的表单 {!! Form::open([
我遇到了一个问题,当用户闲置超过 24 小时(我的 session 超时),或者离开站点然后在 24 小时后返回时,他们并没有从站点注销,但是他们的session 已过期,或者至少他们的 _token
当 session 过期时,用户无法在不刷新页面的情况下重新登录,因为 ajax header 中的 _token 已过期(又名 TokenMismatchException)。我无法通过将用户重定向
在我的 Laravel 5 应用程序中,管理员可以上传产品图片和产品的 pdf 文件。因此,表单有 2 个输入字段,如下所示: {!! Form::label('image
我有一个工作表: {!! Form::open() !!} Name
我如何添加此输入: 到 FineUploader 而不创建表单? 最佳答案 您可能已经解决了您的问题,但这可能会帮助其他人跨越这个线程。以下对我有用: 在 : 然后按如下方式初始化您的fineU
我很惭愧问这个问题,因为这个问题已经被其他人问过很多次了,但是我自己找不到任何解决办法。 我正在使用 Laravel 5.3,我根据文档和其他 stackoverflow 主题创建了一个简单的表单。
我在我的生产服务器上遇到 TokenMismatchException,但应用程序在本地 Xampp 服务器和另一个主机上运行良好。它是我们的内部服务器,因此我们无法更改它。我们不得不使用它,但我们不
我的应用程序的 POST cURL 请求有问题。目前,我正在使用 laravel 5 构建 RESTFUL 注册功能。 这个例子的路由是 localhost:8000/user/create 我在终端
我的 laravel 版本是 5.5,在我的应用程序中没有任何错误。 当我将我的 laravel 版本升级到 5.6 时,发生了 laravel TokenMisMatchException。我已经在
我是一名优秀的程序员,十分优秀!