I have a script.js setting the server up that goes like this:
var io_session = require("express-socket.io-session");
var e_session = require("express-session")({
secret: "a-secret",
resave: true,
saveUninitialized: true
});
(...)
//this block is the last "io.use" before the socket logic (io.on("connection"))
io.use(io_session(e_session,{
autoSave: true
}));
In my typescript / angular2 frontend enviroment using the following seed https://github.com/NathanWalker/angular2-seed-advanced I perform http requests in several services / components using the Http class.
However, when I try to request the server again for something I try to log the user session, nothing is logged... I don't really know why this is happening as not only the session for the user is not being kept but also the session is not being shared from the http to the socket layer system (as obviously, if it isn't created it isn't also being shared).
Does anyone know what might be wrong here? I can provide more info if needed but I don't really know what is missing.