DSP

使用PHP实现跨域COOKIE

2019-07-13 18:15发布

PHP代码 1. 2. header('P3P: CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV"');//p3p
3. setcookie("TestCookie","test",time()+3600,"/",".a.com");//设置cookie
4. ?> 再放置一个readcookie.php 内容:
PHP代码 1. 2. echo $_COOKIE["TestCookie"];
3. ?> 然后在b.com下放置setcookie.php ,内容:
JavaScript代码 1.