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').
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
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.
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.