某些设备上的VerifyCsrfToken.php第68行中的Laravel 5.4 TokenMismatchException [英] Laravel 5.4 TokenMismatchException in VerifyCsrfToken.php line 68 on some device

查看:77
本文介绍了某些设备上的VerifyCsrfToken.php第68行中的Laravel 5.4 TokenMismatchException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是这里最受欢迎的问题之一,但是我真的在google的前10页结果中阅读了所有内容,但没有任何东西可以解决我的问题.

I know it's one of the most asked question around here, but I really read everything on the first 10 pages results on google and nothing solved my problem.

在laravel 5.4的新安装上,当我尝试注册(或登录)时通过 php artisan make:auth 生成了auth控制器,视图等. 某些设备,我收到以下错误消息:

On a fresh installation of laravel 5.4 , generated the auth controller, views, etc. via php artisan make:auth when I try to register (or login) in some device I get the following error:

TokenMismatchException

TokenMismatchException in VerifyCsrfToken.php line 68

我正在debian 8.7和php7上在本地运行此应用程序(可能与问题有关吗?) 从我的PC iphone 7,另一个Windows 10桌面上,它可以完美运行,但是在Huawei p8 lite,ipad 2和lubuntu(相当旧的版本)上,我得到了该错误.因此,这真的很奇怪,因为它只是在某些设备上发生的(无论操作系统是什么,无论使用哪种浏览器).

I'm running this application in local on debian 8.7 and php7 (could it be related to the problem in some way ?) From my pc, iphone 7, another windows 10 desktop it works perfectly, but on a Huawei p8 lite, ipad 2 and lubuntu (quite old version) I get that error. So it's really weird because it just happends with some device (no matter whaht O.S. no matter what browser).

我已经可以告诉您,我已经尝试授予对会话文件夹的权限,更改session_domain,清除缓存(但正如我所说,我是在全新安装中尝试这样做),将{{csrf_token}}更改为{! csrf_token !!}等

I can already tell you that I tried grant permissions to sessions folder, change session_domain, clearing cache (but as I said I'm trying this on a fresh installation), change {{ csrf_token }} to {!! csrf_token !!} , etc.

仅是为您提供有关我的系统的更多信息,这是我正在使用的php版本:

Just to give you more information about my system, this is the php version i'm using:

php --version
PHP 7.0.17-1~dotdeb+8.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.17-1~dotdeb+8.1, Copyright (c) 1999-2017, by Zend 
Technologies

我真的坚持了好几天.没有更多的想法.

I'm really stuck on this for days. Got no more ideas.

推荐答案

我遇到了同样的问题.我做了这些步骤.

I had the same issue. I did these steps.

  1. php artisan cache:clear //cache clear
  2. <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"> //place inside the form tags
  1. php artisan cache:clear //cache clear
  2. <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"> //place inside the form tags

这篇关于某些设备上的VerifyCsrfToken.php第68行中的Laravel 5.4 TokenMismatchException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆