Re: note 8484 added to setcookie

From: Date: Thu, 14 Sep 2000 22:08:38 +0000
Subject: Re: note 8484 added to setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-4966@lists.php.net to get a copy of this message
You should've read the cookies spec (URL is listed in the manual page), which explicitely mentions this: "... If a CGI script wishes to delete a cookie, it can do so by returning a cookie with the same name, and an expires time which is in the past. The path and name must match exactly in order for the expiring cookie to replace the valid cookie. This requirement makes it difficult for anyone but the originator of a cookie to delete a cookie. ..." Your note has been removed. --- pyoung@dstc.edu.au wrote: > I was having problems unsetting a cookie, I need to > do this so > that a user could "logout" of a php program > > I read all the notes in this section to no avail > What did work was > > if I set the original cookie up like > setcookie("MYCOOKIE",$value,time() + 3600,"/"); > > I could reliably unset it with : > setcookie("MYCOOKIE","",time() -10 ,"/"); > > I.E set the time as a relative negative ( I got this > from a Javascript manual) > > Hope this helps other head bangers > ( have to say that the php4 documentation is not > good ) I have to say, you do not read the manual pages carefully. > > http://www.php.net/manual/function.setcookie.php > > > -- > PHP Notes Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-notes-unsubscribe@lists.php.net > For additional commands, e-mail: > php-notes-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > ===== --- Jesus M. Castagnetto (jcastagnetto@yahoo.com) __________________________________________________ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/

« previous php.notes (#4966) next »