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

ctwx's avatar
Level 1

Sometimes I got logged out (L5.2 Auth)

I started a new Laravel 5.2 project, then I ran php artisan make:auth to create login/register stuff. Then I created some models, controllers and views. Now I am able to create Appointment objects.

Because I want to use this page internally I use the auth middlware on all routes. I realized this by a Route::group in the routes.php. But sometimes I get logged out for no apparent reason. Addionaly sometimes get a TokenMismatchException in VerifyCsrfToken.php line 67: error.

How can I debug this? I didn't changed anything in the Kernel or stuff. I have really no Idea what I can do now.

edit I might have a solution. Now testing... https://laravel.com/docs/master/routing#csrf-x-csrf-token edit2 No it's not. I still get logged out. :/

0 likes
1 reply
ctwx's avatar
Level 1

That was the last thing I expected. It seems you're right. Thank you for you answer.

Please or to participate in this conversation.