<?php
//c.php页面
session_start ();
$_SESSION ['test'] = 'test';
echo 'session["test"]=' . $_SESSION ['test'];
?>
<a href="d.php?<?php echo htmlspecialchars(SID);?>">D</a>
<?php
//d.php页面
$sid = $_GET ['PHPSESSID'];
session_id ( $sid );
session_start ();
echo 'session["test"]=' . $_SESSION ['test'];