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

jbandara1988's avatar

How to manage PHP sessions when scaling?

Hi, When we decided to scale the app across multiple servers, one problem we are facing now is how to manage sessions. Technically we can say, we should use Redis service to mange sessions or something. But I would eager to know how people in production environment handled this kind of scenario. How Laracast handles this?

Did you have a dedicated server with Redis service to manage the session? if so isn't it a single point of failure? Or did you use some other technique?

Highly appreciate any comments or references.

Thank you :)

0 likes
3 replies
click's avatar

Simplest approach is to store your sessions in your database (mysql) because you probably already have that available.

See https://laravel.com/docs/5.8/session for more info on that. In short it is setting the driver to database in your config. Create a migration to setup the session database table and you should be good to go.

Redis also works of course... but if you do not have that available at the moment your mysql DB would be a good start.

jbandara1988's avatar

Hmm, in either scenario, either DB server or Redis server should be an independent yeah?

Thanks for both answers @click and @jlrdw :)

Please or to participate in this conversation.