Answer the question
In order to leave comments, you need to log in
How to check authorization in Node.js?
Good day!
There is a project on Yii2. It is necessary to implement a chat with preference and profurnets.
At the moment there is a connection to the server using socket.io. After the connection, the user ID is transmitted. How to check if a user is logged in? Is it safe to transfer a token along with the user ID and compare the transferred token on the server with the user token from the database? I understand that in this case, anyone can connect to the server, knowing the token. Is it possible to use something that Yii2 stores in cookies? If so, how can this be deciphered?
Answer the question
In order to leave comments, you need to log in
When authenticating a user in PHP:
On the client in JS:
On the socket server:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question