Support the ongoing development of Laravel.io →
Authentication Session Forms

Hi! I'm a new Laravel user, coming from cakephp. I've created an aplication with an initial login form, is an ERP. The login form was created with artisan, all by default (php artisan make:auth). I've noticed an strange behaviour. If I log without check the "remember me" checkbox, the csrf token is the same in all the session, I suppose is the normal behaviour. BUT, if I check the "remember me" checkbox, then, every request renews the csrf token and I receive many mismatch tokens exceptions, especially in ajax calls (the first call works fine, the following not). I've used the documentation sample:

https://laravel.com/docs/5.4/csrf#csrf-x-csrf-token

Is very strange I think, some idea? I tried to store the sessions in files and in database, and the result is the same. I've the last 5.4 laravel.

Thanks! Jordi

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

jviure jviure Joined 4 Jan 2015

Moderators

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

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.