Forum Moderators: coopster
I have an issue which I cannot seem to work out. I have a cookie that I set in one place that is visible over the entire domain, but when I try to kill the cookie when I log out from another area of the website, I cannot seem to kill it, even though the "/" path switch is set to all domain.
Folder structure:-
website_root/update/index.php (cookie set call here on successful form submission)
website_root/update/update_control/session_set.php (set cookie function in here)
website_root/index.php (main parsing file for the entire site)
website_root/session_control/cookie_monitor.php (file to kill cookie on log out)
(this code sets cookie, this part works)
// Set cookie if specified..
if(isset($_POST['update_cookie']) == "yes")
{
setcookie($control['cookie'], $control['cookie_login'], time()+60*60*24*30, "/");
}
//Return 1 so that the script can proceed without error
return(1);
(this part is part of the function which is called but the cookie still remains even though echos prove as each part is actioned)
if($log_out_status)
{
if (isset($_COOKIE[$control['cookie']]))
{
//I think the problem is how this is structured, and this is where i need the help...
setcookie($connection['cookieLogin'], "", "0", "/");
unset($_COOKIE);
}
session_unset();
session_destroy();
unset($_SESSION);
header("Location: index.php");
}
Any advice is appreciated, then I can go and celebrate new years!
MRB
HAPPY NEW YEAR TO EVERYONE!