I am starting session in login.php,
My “login.php” Script is following
<?php
session_start();
if (!isset($_SESSION['name']))
{
$_SESSION['name'] = “Bob”;
include ('main.php');
}
else
{
include ('main.php');}
}
?>[/COLOR]
In “main.php” I can easily track session by
[COLOR=RoyalBlue] <? echo $_SESSION['name']; ?> // work fine
// output “Bob”[/COLOR]
But problem arising when I want to call “news.php” from “main.php” there I can’t track session by
[COLOR=RoyalBlue] <? echo $_SESSION['name']; ?> // Not working,
//output “ ”[/COLOR]
Please write code that I can track session in all pages of my website.