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

lionweb's avatar

Session database driver and load balancer

Hello, I have load balancer with SSL redirection in Hetzner and two application VPS with one database server and one remote storage (SFTP). I have set up trusted proxies and I see correct user IP in sessions table (before trusted proxies I saw load balancers IP). But still if I refresh admin panel sometimes is user logged on and sometimes dont (if it will swtich form one server to another). What else should I set-up?

0 likes
3 replies
neilstee's avatar

@lionweb also check your SESSION_DRIVER. It has to be shared on both apps like redis.

lionweb's avatar

Thank you for your reply. I have same APP_KEY on both servers and my SESSION_DRIVER is also set on both to database

Please or to participate in this conversation.