php不同域名跨域

a.cn/index.php

<?php
session_start();
$sessId = session_id();
echo '<img src="http://b.cn/index.php?sid='.$sessId.'" width="1" height="1"/>';
var_dump($_COOKIE);

 

b.cn/index.php

 

<?php
$sessId = session_id($_REQUEST['sid']);
session_start();
var_dump($_REQUEST['sid'],$sessId);

 

分别打开a.cn 和 b.cn 打开控制台查看请求cookie发现两边是一样的

posted on 2018-05-14 19:58  长风剑客  阅读(176)  评论(0编辑  收藏  举报

导航