Hi Friends,
I have problem while getting assigned values from $_SESSION['MM_Username'] variable.
I am assigning the value, for this variable in login.php, the code looks like
session_start();
$_SESSION['MM_Username'] = $loginUsername;
and from this assigned session variable, i am trying to get the values from header.php file, code looks like
session_start();
if(isset($SESSION['MM_Username']))
{
$loginUsername = $SESSION['MM_Username'];
}
else
$loginUsername = '';
if(!$loginUsername == '')
{
echo('Logged in As ' . $loginUsername );
}
else
echo('Not logged in, <a href="html/login.php" >Login</a>');
By running the above code, i am always getting "Not logged in , Login", message.
because, isset($_SESSION['MM_Username']) is returning false.
I have tried,with registering the session variables also, but gettig the same problem.
Please suggest me, the possible solutions.
Thanks in Advance,
Madhav Bitra.