0

Im trying to avoid using express sessions and do user authentication with socket.io only (mean setting up and checking httponly cookies), but this code do not work:

io.on('connection', function (socket) {
    socket.on('signin', function (data) {
        socket.request.headers.cookie = 'COOKIE=testcookie'; // do not work
    });
});

io.of('/logged').use(function (socket, next) {
    socket.request.headers.cookie; // Empty
});
Ivan M
  • 539
  • 3
  • 13

1 Answers1

1

I check sources - there is no appropriate way to do this, so its beter to use express.cookie management instead

Ivan M
  • 539
  • 3
  • 13