I have app in node.js using socket.io for websockets(live chat) it runs on live-chat.dev domain.
Now i have another project runs on localhost where i'm connecting to live-chat.dev (client side).
I identify users by session.id that stores in node.js app.
The problem is : every page reloads brings new session.id generated.
config of node.js session middlware :
var sessionMiddleWare = session({
secret: 'livechat key',
resave: false,
saveUninitialized: true,
cookie: {
domain : 'localhost'
}
});
io.use(function(socket, next) {
sessionMiddleWare(socket.request, socket.request.res, next);
});