session变量一个页面中设置后到另外页面无法取值的问题?
原:
$_SESSION["user_name_login"]=$row['UserName'];
$_SESSION["user_id_login"]=$row['UserID'];
$_SESSION["user_role"]=$row['RoleID'];
$_SESSION["user_type"]=$row['TypeID'];
修改后
session_start();
session_unset();
session_destroy();
session_register("user_name_login");
session_register("user_id_login");
session_register("user_role");
session_register("user_type");
$_SESSION["user_name_login"]=$row['UserName'];
$_SESSION["user_id_login"]=$row['UserID'];
$_SESSION["user_role"]=$row['RoleID'];
$_SESSION["user_type"]=$row['TypeID'];
$_SESSION["user_name_login"]=$row['UserName'];
$_SESSION["user_id_login"]=$row['UserID'];
$_SESSION["user_role"]=$row['RoleID'];
$_SESSION["user_type"]=$row['TypeID'];
修改后
session_start();
session_unset();
session_destroy();
session_register("user_name_login");
session_register("user_id_login");
session_register("user_role");
session_register("user_type");
$_SESSION["user_name_login"]=$row['UserName'];
$_SESSION["user_id_login"]=$row['UserID'];
$_SESSION["user_role"]=$row['RoleID'];
$_SESSION["user_type"]=$row['TypeID'];