Once user provides username and password on Login page, it is then submitted to another page which has -
session_start();
$_SESSION['username']=$_POST["username"];
Based on some validation, the page is redirected to different pages based on the code below
session_write_close();
/* Redirect browser */
header("Location: ../menu.php");
Then, on menu.php, all I tried to do is -
<?php
session_start();
echo "User is ".$_SESSION['username'];
?>
But its not working :(. Works on the same page though but not after redirection. Tried with setcookie etc but no luck. Appreciate any help !!