node.js - In Socket.io, how to get the stored cookie information? -


in node application using express, have stored cookie information. need stored cookie information in socket.io. how can this?

    app.use(function (req, res, next) {          res.cookie('cookiename','1', { maxage: 50000, httponly: true });     });      io.sockets.on('connection', function (socket) {       //here need access cookie.how can      }); 

finally found answer.the below code cookie information.

     io.sockets.on('connection', function (socket) {            var cookie=socket.handshake.headers['cookie'];       }); 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -