1.a.php页面
1 session_start(); 2 $_SESSION['msg'] = "i love you"; 3 $sn = session_id();//获取当前session的id 4 header( 'Content-Type: text/html; charset=utf-8' ); 5 //跳转到index.php页面,并把session的id传递过去,sn可以随便写 6 header("Location: index.php?sn=".$sn);
1 session_start(); 2 $_SESSION['msg'] = "i love you"; 3 $sn = session_id();//获取当前session的id 4 header( 'Content-Type: text/html; charset=utf-8' ); 5 //跳转到index.php页面,并把session的id传递过去,sn可以随便写 6 header("Location: index.php?sn=".$sn);
相关文章: