G
G
GaserV2016-04-28 23:32:25
JavaScript
GaserV, 2016-04-28 23:32:25

Token error, Laravel?

Lord, tell me. What actually could be the matter? Laravel throws an error - TokenMismatchException in VerifyCsrfToken.php line 67. At the same time, the session exists, the user is authorized

Answer the question

In order to leave comments, you need to log in

5 answer(s)
N
nepster-web, 2016-04-28
@nepster-web

https://learn.javascript.ru/csrf
You need to pass a secret token with every non-GET request.

A
Andrzej Wielski, 2016-04-28
@wielski

In the form, insert an input with a csrf token:
{!! csrf_field() !!}

M
Mikhail Osher, 2016-04-29
@miraage

RTFM .

E
enavermate, 2016-04-29
@enavermate

Muddy topic))))
There are many different working options (up to setting the correct time zone!)
Here is proof: laravel.io/forum/01-30-2015-laravel5-tokenmismatch...

G
GaserV, 2016-04-29
@GaserV

Karoch poked around in Google and found the only solution needed.

headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question