currently i am starting a session as follows:
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();
}
as you can see i am wondering if $_SESSION['username']=$_POST['username'];
is the best way to start a session or if there are better practices
Thank you for any responses!