I have two sites sitting in Laragon that both use the default authentication that comes with Laravel 5. For some reason users keep getting logged out at random and I've no idea what could be causing it. I thought it could be a conflict with the two sites, but I've changed the session and cache names and it's still doing it.
Just wondering if anyone had any ideas about what it could be?
Are you up to date, I believe there was a bug that caused this after a couple of redirects. Check bug site. Also are you sure your two sites aren't set up as one site by accident. Check.
How do I check that they're different? I have the session, cache and app key set as unique for each site, is there anything else I've missed? I'll check out the bug site, but I had it set up on a Linux box for testing and I didn't notice this issue there, it's only since I've moved to Laragon on Windows and separated the sites that the issue has come about.
To me sounds like the session is on both, you are sure they are setup as two entirely different sites. Search here and stackoverflow, I saw this topic a while back where a session was dropping.
Check some of these https://laracasts.com/discuss?q=Session+lost
The session name is definitely different. Before I changed the name you wouldn't be able to log into both sites at the same time but now that I've changed it you can.
After reading through some of those topics I have a bit more information.
Sessions are created and stored in two separate locations.
I deleted the two cookies and signed in to one of the sites and it is only showing the one cookie.
However, if I have both the cookies in my browser, every now and then the Last Accessed On timestamp for both cookies is changed at the same time when I load a page instead of just the one.
So if it's accessing the cookie for the site that you haven't been using and it's past the session expiry, could that be what's logging users out?
If these are supposed to be two completely separate sites, you may have set them up wrong. Perhaps do a general site search for deploying multiple laravel sites on same server, multiple laravel sites on same server, and similar key words. But something is over lapping. Also you could start a new topic and ask how to set this up, but give all information,
Is it a dedicated server.
Is is a hosting company, which one, etc.
Hope this helps, and I hope you figure it out.
In my case this was an issue with the cached config file. Laravel creates a config file which is cached inside bootstrap/cache folder. Rename this config.php file to something else and run "php artisan cache:clear"