PHP SESSION读取问题,为什么老是报错session已经开启
<?php
/**
*fileName 1.php
*
*/
$id = 999898;
$key = 'order_87';
$_SESSION[$key] = $id;
if(!isset($_GET['code']))
{
header('Location:http://www.test.com/');
//流程是第一次去请求接口,接口会返回$_GET['code'],接口会重新请求本1.php
//我需要在接口返回code之后保存$id的值
}
else
{
$code = $_GET['code'];
}
$id = $_SESSION[$key];
//为什么这里会报notice 错误 undefined index $key ?我明明先设置了的,session已经开启
sessionstorage session php cookie cookies