I tried setting cookies across domains in IE, but none of them worked. I checked the information and found that it can be achieved by setting the p3p value in the header. It’s really good:) For example, if you want to visit site b and set it up at site a. A cookie, you can do this:
1. Create a file cookies.htm under b.com
The content is:
Copy the code code as follows:
<script language=javascript src=http://a.com/setcookies.asp?par=a.com></script>
2. The content of setcookies.asp under a.com is:
Copy the code code as follows:
<%
Response.AddHeader P3P, CP=CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR
Response.Cookies(aaa).Domain = Request(par)
Response.Cookies(aaa) = These are cookies set under b.com by accessing files under a.com
%>
In this way, by accessing the cookies.htm file under b.com, the corresponding cookies can be set and modified under domain a.com, thereby achieving the purpose of setting and accessing cookies across domains.