<?php
if(isset($_GET['PHPSESSION'])){
session_id($_GET['PHPSESSION']);
}
session_start();
$sid=session_id();
$_SESSION['test']='123';
echo "<a href='2.php?".SID."'>qqq</a>";
?>
2.php
<?php
if(isset($_GET['PHPSESSION'])){
session_id($_GET['PHPSESSION']);
}
session_start();
echo $_SESSION['test'];
?>
通過修改php.ini中 session.use_trans_sid = 1 頁面中的a鏈接會自動加上SID參數
但是js跳轉 表單的action, header跳轉 需要手動加上SID