I have 3 running DO Linux Ubuntu 20.04 droplet servers that works well with functionally login session using apache2 with Laravel 8.
When I use load balancer to this 3 droplets, it works and show the webpages well with SSL. The problem occurs when going to login (creating session) and then it will show 419 page expired.
What I have done for the 3 servers:
- CSRF on form
- chmod 775 on vendor, bootstrap cache, storage
- php artisan cache:clear + php artisan config:cache
- Using session database instead of default session files (also checked the session is stored well in the database on each droplets)
Most people with the same problem got solved by solution number 4 (database session), but it still doesn’t work on my load balancer. I haven’t found any other solutions so please if maybe anyone know how to solve this problem.
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
you have to use a shared db for all the droplets such as digital ocean managed service.
The user session is managed with the database, so you have to “share” the info between all the droplets.