我正在尝试设置会话变量,但它不起作用。这是我在代码中所做的。请提出问题所在:
登录验证器.php
<?php
session_start();
$userName = "test";
$_SESSION['iUsername'] = $userName;
header("Location: http://www.XXXXXXXXXXXX.com/LoginSuccess.php");
?>
登录成功.php
<?php
session_start();
$User = $_SESSION['iUsername'];
echo $User;
?>