Answer the question
In order to leave comments, you need to log in
Authentication (Node.js Express-session), I can't figure out how it works, can you help?
I'm using express-socket.io-session on top to be able to consume data over socket.
Here are the docks: https://www.npmjs.com/package/express-socket.io-session
I'm including them below.
var session = require("express-session")({
secret: 'boss',
resave: true,
saveUninitialized: true,
cookie: {
maxAge: 25200000
}
});
var sharedsession = require("express-socket.io-session");
app.use(session);
// Use shared session middleware for socket.io
// setting autoSave:true
io.use(sharedsession(session, {
autoSave:true
}));
sess = socket.handshake.session;
//sess.connect;
sess.uid = socket.id;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question