A
A
antimodern2019-02-19 21:48:56
Node.js
antimodern, 2019-02-19 21:48:56

How to bind sockets to sessions?

Node/Express application. The front is a separate SPA, but the domain is the same. example.com/api

Sessions and authorization are done using express-session. The session is stored in cookies httpOnly. Connected sockets - socket.io. Everything works, but now we need to somehow tie it together.

How to correctly bind authorization on sessions with sockets? How to transfer session there? There are no tokens on the front, there is no JWT here. How to identify on the back to whom, what session the socket belongs to?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question