W
W
WebDev2015-10-23 12:39:34
Node.js
WebDev, 2015-10-23 12:39:34

Sessions on socket.io in node.js?

I started digging into node js, please tell me how to remember the user in socket.io? It is possible to send to a specific person by his id, but this id is new after each reboot. How to organize this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Aves, 2015-10-23
@Aves

The question contains the answer - sessions.
And search will help with the implementation - https://github.com/xpepermint/socket.io-express-session for example.

K
Konstantin Kitmanov, 2015-10-23
@k12th

Store in a database (redis/mongo/leveldb/mysql) or write/read from a file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question