I have created session for my website.To have session started i have wrote following code on each link of website:
session_start();
if(isset($_SESSION['User']))
{
//session_start();
$sesvar = $_REQUEST['sid'];
}
else
{
$sesvar = " ";
}
But when I click log out button session get destroyed.But value of sid(ie parameter to set session variable is set to null.)To destroy session i wrote following code:
if(isset($_REQUEST['out']))
{
session_start();
session_unset();
//unset($_SESSION['User']);
session_destroy();
header("Location:login.html");
exit;
}
After logout as i get sid=null and after that if i click any link of website the welcome msg is still there with null session variable.Please help.