Ninjakreborn Posted September 9, 2010 Share Posted September 9, 2010 <?php session_start(); setcookie("user_id", "", time()-3600, "/", "www.mystagingsite1.net"); setcookie("territory", "", time()-3600, "/", "www.mystagingsite1.net"); setcookie("membership_level", "", time()-3600, "/", "www.mystagingsite1.net"); session_destroy(); header("Location: gateway.php"); ?> I am setting them using set cookie like: <?php setcookie("user_id", $row['user_id'], time()+3600, "/", "www.mystagingsite1.net"); setcookie("territory", $row['territory'], time()+3600, "/", "www.mystagingsite1.net"); setcookie("membership_level", $row['membership_level'], time()+3600, "/", "www.mystagingsite1.net"); ?> This is not deleting cookies. It should be. If I do this and it redirects me then I revisit the homepage, I am still logged in even after doing this. I have tried doing this in about 20 different ways and these stupid sessions won't die. I even tried unsetting them manually as well, nothing is working. Advice? Quote Link to comment https://forums.phpfreaks.com/topic/212997-cant-delete-cookies/ Share on other sites More sharing options...
fortnox007 Posted September 9, 2010 Share Posted September 9, 2010 this could be nothing, but your it looks like your setting cookies in the future : ) will this work? setcookie("user_id", "", time()-5000, "/", "www.mystagingsite1.net"); setcookie("territory", "", time()-5000, "/", "www.mystagingsite1.net"); setcookie("membership_level", "", time()-5000, "/", "www.mystagingsite1.net"); Quote Link to comment https://forums.phpfreaks.com/topic/212997-cant-delete-cookies/#findComment-1109314 Share on other sites More sharing options...
Ninjakreborn Posted September 9, 2010 Author Share Posted September 9, 2010 I figured out finally it was working it was just Google Chrome/Canary issues. I am unsure why, but they sometimes have Cache issues. I guess they are finally starting to get in the way. Quote Link to comment https://forums.phpfreaks.com/topic/212997-cant-delete-cookies/#findComment-1109361 Share on other sites More sharing options...
rwwd Posted September 9, 2010 Share Posted September 9, 2010 Pardon my ignorance here but:- <?php session_start(); setcookie("user_id", "", "0", "/", "www.mystagingsite1.net"); setcookie("territory", "", "0", "/", "www.mystagingsite1.net"); setcookie("membership_level", "", "0", "/", "www.mystagingsite1.net"); unset($_COOKIE); unset($_SESSION); session_destroy(); header("Location: gateway.php"); ?> Wouldn't that be a more pragmatic approach to killing off cookies? Cheers, Rw Quote Link to comment https://forums.phpfreaks.com/topic/212997-cant-delete-cookies/#findComment-1109363 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.