SoFunction
Updated on 2025-04-03

A js script for writing cookies across domains (recommended)

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<script>
 var setcookitarray = "";
 setcookitarray = "[\"/main/?domain=\",\"/main/setCookie/main/?domain=.\",\"/main/setCookie/main/?domain=.\",\"/main/setCookie/main/?domain=.\"]";
 setcookitarray = eval(setcookitarray); 
 var setcookitarrayln = ; 
 //alert(setcookitarrayln);
 var notifyurl_list=setcookitarray;
 var ll = setcookitarrayln;
 var params="yqVg1ennsNnxydEq4azcAP6TjhR90QCEUtB7gs45H08ltXBUNeoy_GczVyqC6cvZEwPGN0Al8XWKDsIt60YO1QsUlbK0Fip73Xz@7djs3ZmhBbAdanMbUH1Y@MVD2@@keR0S7njF5xiy@m6zaRWYNMbJ23jLDSrvEtMj0BExfYvFFe@twp3RHfD41dJOQzWz@nf8i@tJB12hNLIG4oW0eA==";
 var failuretime=2678400;
 var backurl="";
 //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);
			
			//Dynamic generation of script script tag execution url page			var login=request("loginScript"+num,url);
			num--;
      if (num < 0) {
				
        (function() {
           = backurl;
        }, 2000);
				
      }
			else
			{
				loginALL(notifyurl_list, num, backurl, params,failuretime);
			}
     
      
    }
 }
 
 
 
 function request(id,url){
   oScript = (id);
   var head = ("head").item(0);
   if (oScript) {
    (oScript);
   }
   oScript = ("script");
   ("src", url);
   ("id",id);
   ("type","text/javascript");
   ("language","javascript");
   (oScript);
   return oScript;
}
 

</script>


<body>

</body>

The page calls are mainly achieved through recursive calls and dynamically creating script tags.

The above JS script (recommended) for writing cookies across sso is all the content I share with you. I hope it can give you a reference and I hope you support me more.