1

I keep getting the "TokenMismatchException in VerifyCsrfToken.php line 46" error when submitting forms.

This is one of the 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() !!}

The input element with name "_token" gets generated and set as expected.

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?

knospe
  • 340
  • 4
  • 18

2 Answers2

3

Internet explorer rejects sessions from domains with an underscore it. This is a known issue.

Please see here: Issue with Session and Cookie in Internet Explorer for websites containing underscore

And also: http://blogs.msdn.com/b/ieinternals/archive/2009/08/20/wininet-ie-cookie-internals-faq.aspx

Community
  • 1
  • 1
Chris
  • 54,599
  • 30
  • 149
  • 186
  • I have this problem in chrome too in FF forms work fine, any solution? – StealthTrails Aug 27 '15 at 12:38
  • @Adamnick This is a very common problem (Token Mismatch) usually stemming from a misunderstanding of what the token is trying to do. Usually the above answer is not the solution (this one only covers the IE issue). If you are having a token mismatch issue, I would suggest asking your own question and link me to it so I can have a look – Chris Aug 28 '15 at 03:40
0

Probably you have not set the _token parameter in your request to the server or you have put it in somewhere incorrect.

Reza Shadman
  • 617
  • 6
  • 15