That is because you set $SESSION['name'] to $username and $username has no value.
file1.php:
<?php session_start();
$_SESSION['name']="$username";
$iden = $_SESSION['name'];
echo $iden;
?>
//// returns the value in $username
file2.php:
<?php session_start();
$idnew = $SESSION['name'];
echo $idnew;
?>
do this then run it.
file1.php:
<?php session_start();
$username="This is a test of session variables";
$_SESSION['name']="$username";
$iden = $_SESSION['name'];
echo $iden;
?>
//// returns the value in $username
file2.php:
<?php session_start();
$idnew = $_SESSION['name'];
echo $idnew;
?>