SSO a JS script that writes cookies across domains

Source: Internet
Author: User
Tags script tag setcookie

<meta http-equiv= "Content-type" content= "text/html;  Charset=utf-8 "/><script> var setcookitarray =" "; Setcookitarray = "[\" http://passport.a.com/main/setcookie.do?domain=\ ", \" http://passport.a.com/main/setCookie/ Main/setcookie.do?domain=.b.cn\ ", \" http://passport.a.com/main/setcookie/main/setcookie.do?domain=.c.com\ ", \"  Http://passport.a.com/main/setcookie/main/setcookie.do?domain=.d.cn\ "]";   Setcookitarray = eval (setcookitarray);   var setcookitarrayln = setcookitarray.length;  alert (SETCOOKITARRAYLN);  var Notifyurl_list=setcookitarray;  var ll = Setcookitarrayln; var params= "yqvg1ennsnnxydeq4azcap6tjhr90qceutb7[email protected][email protected]@@[email   Protected]@[email protected] @tJB12hNLIG4oW0eA = = ";  var failuretime=2678400;  var backurl= "http://www.test.com";    Alert ("1111");  Loginall (Notifyurl_list, Ll-1, Backurl, params,failuretime);  Alert ("2222"); function Loginall (notifyurl_list,num,backurl,params,failuretime) {var u = NotiFyurl_list[num];        Alert ("URL:" + (num) + "-" +u);            if (typeof u! = "undefined") {//alert ("4444:" +notifyurl_list[num]); var url = notifyurl_list[num]+ "&failuretime=" +failuretime+ "&val=" +params;//alert ("URL:" +url);//            Dynamically generate script Tag execution URL page var login=request ("Loginscript" +num,url); num--;                if (num < 0) {window.settimeout (function () {window.location.href = Backurl;            }, 2000);                             }else{loginall (notifyurl_list, num, Backurl, params,failuretime);}     }} function request (Id,url) {oscript = document.getElementById (ID);     var head = document.getElementsByTagName ("Head"). Item (0);     if (oscript) {head.removechild (oscript);     } Oscript = document.createelement ("script");     Oscript.setattribute ("src", url);     Oscript.setattribute ("id", id);     Oscript.setattribute ("type", "Text/javascript");     Oscript.setattribute ("Language", "JavaScript"); Head.apPendchild (Oscript);  return oscript;} </script><body></body>


The invocation of a page is implemented primarily through recursive invocation and the dynamic creation of a script tag.

SSO a JS script that writes cookies across domains

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.