Back

TokenMismatchException error on local test server


nicdnepr posted 5 days ago

I have project with laravel5, I use such forms

{!! Form::open(['url' => 'search', 'class' => 'search_form input_container', 'novalidate' => true]) !!}

suddenly I start get error TokenMismatchException on local machine- apache+php7.1

Before if works normal

Same project from same repo on product server works fine

How fix it?

Rewan Ali replied 5 days ago

trying this may be useful php artisan cache:clear

nicdnepr replied 5 days ago

didn't help

panicoding replied 5 days ago

Did you include @csrf to your form?

nicdnepr replied 4 days ago

yes here is rendered form

<form method="POST" action="http://ag.local/search" accept-charset="UTF-8" class="search_form input_container" novalidate="1"><input name="_token" type="hidden" value="yl2Y40TRo2n8Ib37HdRVGEMYkfF4p5SexpI52gV4">
            <input class="search_input" type="text" placeholder="" name="search_text" value="">
            <div class="search_padding">
                <img src="/img/user/search/search.png">
            </div>
        </form>

Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us