I'm using express and node to host a server. I also have socket io where I'm trying to keep track of the user by saving their socket.id. However, I have two pages to the webapp, one to login and one for the actual content.
app.get("/", function(req, res) {
res.sendFile(__dirname + "/login.html")
})
app.get("/content", function(req, res){
res.sendFile(__dirname + "/index.html");
})
In my login.html, I have to the user login and then on a click of a button, i set the window.location.href to link to the index.html. Since the client socket io is created in login.html and in the index.html; changing from login to index refreshes the instance, giving the user a new socket.id. How would I get around this and link the user who accessed login.html and then redirected to index.html as the same user?