目前我开始一个会话如下安全会话:PHP如何启动
if ($hasher->CheckPassword($password, $hash)) { //$hash is the hash retrieved from the DB
$what = 'Authentication succeeded';
$_SESSION['username']=$_POST['username'];
header('Location: securedpage1.php');
} else {
$what = 'Authentication failed';
echo "Incorrect Password";
include 'login.php';
exit();
}
,你可以看到我想知道如果$_SESSION['username']=$_POST['username'];
是启动一个会话或者有更好的做法
谢谢你的回复!
我会检索用户的ID并将其存储在会话中。我喜欢我的会话数据被认为是理智的,而有效的ID就是一个例子。 – Kos
谢谢你的回复,你能否解释我将如何检索用户ID并将其存储在会话中? – neeko
什么是“安全会话”,为什么你认为你当前的会话不安全? – zerkms