Answer the question
In order to leave comments, you need to log in
How to get io cookie?
When making a client-server connection, socket.io creates a cookie in the browser called io. If you look at the details of the cookie, then the parameter path is "/socket.io"
How to get this cookie in the application when requesting the main page "/".
I get other cookies like this:
app.get('/', function(req, res){
cookies = cookieParser.JSONCookies(req.cookies);
...
Answer the question
In order to leave comments, you need to log in
If the cookie has a path, then the client will not return a cookie that has a path that does not include the specified path.
You need to pass cookies from http to ws. The example uses redis, but you can do without it.
stackoverflow.com/questions/4753957/socket-io-auth...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question