[SOLVED] Unset cookies

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Cypher87
Forum Newbie
Posts: 5
Joined: Mon Jun 07, 2004 3:20 pm

[SOLVED] Unset cookies

Post by Cypher87 »

Somehow I cant seem to unset cookies. I tried:

Code: Select all

if($_COOKIE["rsoftnaam"]) { unset($_COOKIE["rsoftnaam"]); }
if($_COOKIE["rsoftpass"]) { unset($_COOKIE["rsoftpass"]); }
and:

Code: Select all

if($_COOKIE["rsoftnaam"]) { setcookie("rsoftnaam",$_COOKIE["rsoftnaam"],time()-85000); }
if($_COOKIE["rsoftpass"]) { setcookie("rsoftpass",$_COOKIE["rsoftpass"],time()-85000); }
I even tried both, but it doesnt work... can someone tell me whats wrong (I know its not the if() part cause I tried without it)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

setcookie('name','',time() - 7 * 7 * 24 * 60 * 60);

make sure that you set the path and domain exactly the same too.
Cypher87
Forum Newbie
Posts: 5
Joined: Mon Jun 07, 2004 3:20 pm

Post by Cypher87 »

It works now

thnx :D
Post Reply