I am building a web app that uses socket.io and web worker api to get updates from the server every second. one of the buttons is opening a new window, and when the new window is opened the socket.io stop working and getting bad request response
//part of the code
var socket = io({transports: ['polling']});
worker = new Worker("web_worker.js");
worker.onmessage = function(event){
socket.emit("check_for_updates");
}
//this function is called when a button is pressed
function new_window(client)
{
var uid = client.uid;
var new_window = window.open("/new?uid="+uid);
}
the errors shown in the console:
polling-xhr.js:270 GET http://localhost/socket.io/?EIO=3&transport=polling&t=Mv0tQCC&sid=LnzFU8ClZrY0NHK5AA-r 400 (Bad Request)
polling-xhr.js:270 POST http://localhost/socket.io/?EIO=3&transport=polling&t=Mv0tQC-&sid=LnzFU8ClZrY0NHK5AA-r 400 (Bad Request)