multi-server using store redis to sync session. when disconnected what will happen?
Hi everybody, I have a question.
I have 2 server socket.io and sync session by store redis. So i have 1 client connect then 2 server will contain same session.
But when i disconnect, Are both servers delete session?
They should delete the session, but they do not. Check out this links: https://github.com/LearnBoost/socket.io/issues/831 https://github.com/SpiderStrategies/socket.io/commit/caa96a5cc207aaff23db94a03a2412f5a8c8a4f6 https://github.com/observing/socket.io/commit/6d458d86697ddd8b10f68905fec02ca9feb3541c
I applied the changes proposed in these links to avoid memory issues caused by socket object references.
As you're using the RedisStore you might also be interested in reading this: https://medium.com/p/2c8ad1153332 before considering using it in production.
tks @nicoburghi , @radicans I have do manual by: When disconnect at a server. I using pub/sub redis for sync "socket.id" to other server. then call function "socket.disconnect()"
That's ok!