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

JoewyZN's avatar

User automatically Logged out after a few seconds Laravel 5.4

Hi, just upgraded to 5.4 and im using the exact same method from low versions to login the user

Auth::attempt which works fine but my user gets logged out just seconds after. Anyone experienced this before ? If so, how did you fix it ?

0 likes
3 replies
jlrdw's avatar

Check the settings for session. I am on 5.5 now, and have no problems.

JoewyZN's avatar

Thanks for the reply.. Dont wanna sound nooby but.. I have never edited the session file before, I always use the defaults .. What do i need to check for ?

JoewyZN's avatar
JoewyZN
OP
Best Answer
Level 1

Managed to figure it out.. Since i use laravel for pretty much all my projects, I forgot to change the session name, as a result, one session was overwriting the other, causing the auto-loggout.. So if you have multiple laravel projects running, make sure they all have different session names. Hope this helps someone in future !

1 like

Please or to participate in this conversation.