Forum Laravel Cannot log in - Session not working in artisan serve but in valet it does
Hey, I don't know why but my session is not working while using php artisan serve --host 0.0.0.0
php artisan serve --host 0.0.0.0
First I had to remove \App\Http\Middleware\VerifyCsrfToken::class,, but now while debugging on my phone I want to log in and it won't work.
\App\Http\Middleware\VerifyCsrfToken::class,
I think my SESSION_DOMAIN is wrong, but I cannot figure it out.
SESSION_DOMAIN
With Laravel Valet my .env looks like this: (everything works fine with it)
.env
APP_URL=http://myproject.test SESSION_DOMAIN=.myproject.test #using it for subdomains
Now with php artisan serve it's
APP_URL=http://192.168.1.34:8000 SESSION_DOMAIN=192.168.1.34
But I had to remove VerifyCsrfToken because for some reason I get TokenMismatchException.
VerifyCsrfToken
TokenMismatchException
I don't want to use Laravel Valet Serve because it is so slow...
Any idea why my session is not working?
Please sign in or create an account to participate in this conversation.
There's no shortage of content at Laracasts. In fact, you could watch nonstop for days upon days, and still not see everything!
Get Started
Cannot log in - Session not working in artisan serve but in valet it does
Hey, I don't know why but my session is not working while using
php artisan serve --host 0.0.0.0
First I had to remove
\App\Http\Middleware\VerifyCsrfToken::class,
, but now while debugging on my phone I want to log in and it won't work.I think my
SESSION_DOMAIN
is wrong, but I cannot figure it out.With Laravel Valet my
.env
looks like this: (everything works fine with it)Now with php artisan serve it's
But I had to remove
VerifyCsrfToken
because for some reason I getTokenMismatchException
.I don't want to use Laravel Valet Serve because it is so slow...
Any idea why my session is not working?