podja Posted January 2, 2008 Share Posted January 2, 2008 Hi, I have a login script which sets 2 cookies: setcookie('username', "$user", time()+60*60*24*30, "/", ".ilkleysb.com", 0); setcookie('password', "$pass", time()+60*60*24*30, "/", ".ilkleysb.com", 0); I then have a logout script that is meant to delete the cookies: setcookie('username','',1); setcookie('password','',1); header("location:index.php"); The cookie doesnt seem to get deleted though. Any help would be appreciated! Thanks. Link to comment https://forums.phpfreaks.com/topic/84123-solved-deleting-a-cookie/ Share on other sites More sharing options...
revraz Posted January 2, 2008 Share Posted January 2, 2008 setcookie('username', "$user", time()-60*60*24*30, "/", ".ilkleysb.com", 0); Change the plus to a minus to unset it after time() Link to comment https://forums.phpfreaks.com/topic/84123-solved-deleting-a-cookie/#findComment-428216 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.