V
V
VicTHOR2022-01-28 15:11:50
PHP
VicTHOR, 2022-01-28 15:11:50

How to synchronize session in multiple docker containers?

It is necessary to save user data in a session from a container with Yii2, and get this data in another container and put it in a local session ...
How to do this? I understand that data can be entered into the database, in the same Yii2 there is documentation on how to store sessions in the database, but how to determine the desired session of a specific user in another container?
ip to store still there or what options?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2022-01-28
@VicTHOR

Add a container with Redis and store sessions there. The session ID is passed in the cookie, so you can determine the session of a particular user.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question