Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Firenet's avatar

Laravel 6.4.1 on Post session _token is changed(updated) 419 Error

I face a strange behaviour.

My form has the @csrf token and I click submit button to post the form.

Somehow the session token has been changed after click submit button and there is no match(tokensMatch) with the token posted from the form and the token in the session.

I use file Session Driver with docker-compose.yml and nginx, PHP 7.2.14-fpm

In log files I get Session store not set on request

<form method="POST" id="register_id" action="{{ route('test') }}"> @csrf </form>

Can someone support?

0 likes
3 replies
Nakov's avatar

And is your route within routes.php file? Can you run php artisan route:list and make sure that your route uses the web middleware?

Firenet's avatar

For those they have a problem please check in config/session.php file the value

'secure' => env('SESSION_SECURE_COOKIE', false),

it must be FALSE when working local

Please or to participate in this conversation.