Laravel 5,Forms,VerifyCsrfToken.php第46行中的TokenMismatchException [英] Laravel 5, Forms, TokenMismatchException in VerifyCsrfToken.php line 46
问题描述
提交表单时,我不断收到"VerifyCsrfToken.php第46行中的TokenMismatchException"错误.
I keep getting the "TokenMismatchException in VerifyCsrfToken.php line 46" error when submitting forms.
这是以下形式之一:
{!! Form::model($product, array('url' => 'product/'.$product->id, 'class' => 'form', 'method' => 'PATCH')) !!}
<div class="form-group">
{!! Form::textarea('note', $product->note,
array('class'=>'form-control', 'id'=>'product-note', 'placeholder'=>Lang::get('customtranslation.form_placeholder_note'), 'rows'=>3)) !!}
<br />
<span class="btn btn-link" id="remove-note" role="button"><i class="fa fa-times"></i> {{ Lang::get('customtranslation.button_txt_reset_note') }}</span>
</div>
<div class="form-group">
{!! Form::submit(Lang::get('customtranslation.button_txt_finish_edit_product'), array('class'=>'btn btn-success')) !!}
</div>
<div class="form-group">
<!-- Custom tags -->
{!! Form::label('additional-tags', Lang::get('customtranslation.form_edit_label_additional_tags')) !!}
{!! Form::text('additional-tags','', array('id'=>'additional-tags', 'data-role'=>'tagsinput')) !!}
</div>
{!! Form::close() !!}
名称为"_token"的输入元素将生成并按预期设置.
The input element with name "_token" gets generated and set as expected.
奇怪的是,这仅发生在Internet Explorer(IE11)中. Chrome和FF提交时没有任何问题.
The strange thing is that this occurs only in Internet Explorer (IE11). Chrome and FF make a submit without any problems.
还有其他人有这个问题和可能的解决方案吗?
Does anyone else have this problem and a possible solution?
推荐答案
Internet Explorer拒绝带有下划线的域会话.这是一个已知的问题.
Internet explorer rejects sessions from domains with an underscore it. This is a known issue.
请在此处查看:问题Internet Explorer中使用Session和Cookie来处理包含下划线的网站
并且: http://blogs.msdn.com/b/ieinternals/archive/2009/08/20/wininet-ie-cookie-internals-faq.aspx
这篇关于Laravel 5,Forms,VerifyCsrfToken.php第46行中的TokenMismatchException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!