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

subpublic's avatar

Session cookie changes, but remembers login

Strange problem. I can log in using the standard make:auth-setup. But I can't save any session variables. They disappears after each reload. And my session cookie changes each reload too (as do the laravel_token). Is that normal? I'm running Laravel 5.3.6 and Homestead. I can see files being created in storage/framework/session.

0 likes
1 reply
subpublic's avatar
subpublic
OP
Best Answer
Level 1

I'm going to answer this myself. I had got it all wrong.

If you just want to make simple Ajax requests, don't use middleware('auth:api'). You should use middleware('web').

Please or to participate in this conversation.