.josh Posted June 23, 2006 Share Posted June 23, 2006 here is my code that sets the cookie:[code]setcookie("cowcookie", $_SESSION['Account_Info']['Account_Name'] . " : " . $User_Pw . " : " . time(), time()+12096000);[/code]and here is my code that is supposed to kill it:[code]<?session_start();// kill session variablesunset($_SESSION['Account_Info']);$_SESSION = array();session_destroy(); setcookie ("cowcookie", '', time() - 604800);unset($_COOKIE);unset($HTTP_COOKIE_VARS);?>[/code]it's way past my bedtime i can't see straight. why won't it die? my main page checks to see if the cookie exists. if it does, it redirects me to the logged in page. if it doesn't, it shows the main page. this script is my logout script. the user clicks the logout button and he's supposed to be completely logged out forever. but if i try to put a header to my main page after the unset, it still redirects me to the logged in page. I'm pretty sure my cookie is not dying here, cuz if i go and manually kill all of my cookies through my browser, the cookie detection/redirection script works fine. so what's going on here?? Quote Link to comment https://forums.phpfreaks.com/topic/12715-cookie-wont-die/ Share on other sites More sharing options...
AndyB Posted June 23, 2006 Share Posted June 23, 2006 Are set_cookie and kill_cookie both happening at the same level in the same folder? I had several immortal cookies in a script of mine before I got the path_to_cookie embedded in the script ... if you know what I mean. Quote Link to comment https://forums.phpfreaks.com/topic/12715-cookie-wont-die/#findComment-48752 Share on other sites More sharing options...
.josh Posted June 23, 2006 Author Share Posted June 23, 2006 ah crap. yeh i think that's probably it. will checkedit: yep, that was it. dunno why i didn't think of that. i have a question though:if the path_to_cookie is supposed to specify the scope of the cookie, why must I specify it in deleting cookies? i don't see how that should matter? the manual doesn't go into any of that... Quote Link to comment https://forums.phpfreaks.com/topic/12715-cookie-wont-die/#findComment-48859 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.