A
A
Albert Kazan2019-04-15 00:48:37
Node.js
Albert Kazan, 2019-04-15 00:48:37

How to catch unique user in socket.io?

I am developing cards (to improve skills) for two players.
The user connects and there the server recognizes something in order to emit only on it. But when the user refreshes the page, he connects again and the socket recognizes him as a new user.
What to do? How to store a particular dude? Recover data that was made by him?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2019-04-15
@inoise

Enter registration and after login give the user a token that will be sent to WS upon connection, for example, with the corresponding message {"action":"authenticate", "token":"dsdsfsdfsdfsdfsdfs"}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question