Auth::check() or Auth::user() logs me out automatically

emilmoe posted 3 years ago

I'm facing an issue here which I don't think I had before, however I'm not sure what I changed to introduce it. It seems that I will automatically be logged out, when I have called Auth::check() or Auth::user(), but it's randomly. So if I keep logging into my site like 5-10 times finally I can see 1-2 pages, but next I'm logged out again. I hope any of you know what this issue may cause, as you can see it is very frustrating :-)

emilmoe replied 3 years ago Solution

I restarted the apache server and seemed to fix the problem, I don't know why. I also set the $primaryKey, just in case, although it's id:

martuico replied 2 years ago

It didn't solve my issue. I'm having the same problem

akoSalman replied 2 weeks ago

I have the same issue. Laravel prject logs me out automatically. I don't know why. This problem is local ENV (i'm running project through php artisan serve). When project is UP and running through apache there is no problem.

Sign in to participate in this thread!

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