After logging in to the api interface to obtain data, switching pages shows that you are not logged in.
胡行东
胡行东 2019-03-29 10:56:26
0
2
1595

function Property() {
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft .XMLHTTP");
}

xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
var datastr = xmlhttp .responseText;
alert(datastr);
var dataobj = JSON.parse(datastr)
let dataarr = [];
for (let i in dataobj) {
dataarr.push( dataobj[i]);
}

 
}
}

xmlhttp.open("POST", "https://api.123321yun.com/api /device/queryProjectDeviceParamStatus?projId=66", true);

/* xmlhttp.open("POST", "https://api.123321yun.com/api/user/login?username=test123&password= 123456", true);*/ xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.send();
}

Xiaobai wants to solve the problem that the login status cannot be saved

胡行东
胡行东

reply all(1)
秋香姐家的小书童

The server provider's SESSION is not saved


You can use AJAX to determine whether the user's SESSION exists in the server. If there is, it will be logged in. If not, it will prompt login

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!