I am trouble with session; I know it theoretically but I encountered with it how to use session , transferring username to
Always start session page with session_start().If you want to use session first assign session a value like this :
session_start();
$_SESSION['username'] = 'Mahmood';
And when you want to access get it like this :
echo $_SESSION['username'];
OR
$username = $_SESSION['username'];
And unset this session like this :
unset($_SESSION['username']);
Some Details are here.