目前我正在开始一个会话,如下所示:
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'];
是开始会话的最佳方式,或者是否有更好的做法
感谢您的任何回复!