Solution:
Create a session variable just like this.
$_SESSION["mykey"]="MyValue";
And access this session variable on your other pages.
PS. Make sure to add session_start(); on the top of every page wherever this session variable is being used.