ID:               19638
 Updated by:       [EMAIL PROTECTED]
 Reported By:      cheatah at tweakers dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         Documentation problem
 Operating System: Any
 PHP Version:      4.2.3
 New Comment:

Parameters can be skipped by 0 or '' as documented. How to delete a
cookie is nowadays also documented. However I documented that expire is
compared to client's time.


Previous Comments:
------------------------------------------------------------------------

[2002-10-17 04:55:07] Xuefer at 21cn dot com

yes, it's the same problem trouble me.
then same when setcookie('name', '', 0, '/');

the question is: Is 1 year and 1 second enough ?
when a pc lost battery, and turned off, system clock is reset to long
long ago.

i dunno if a browser compare the "Expire time" to system clock or
"Date: ..." header return by server

the document of php tell us nothing about this.

currently, i have to do:
setcookie('name', "0", 0, '/');
and change my script isset($_COOKIE['name']) to
!empty($_COOKIE['name'])
even javascript:
var myc = mygetcookie('name');
if (myc && myc != '0')
{
 //.......
}

hope there's a final solution to this problem :)

------------------------------------------------------------------------

[2002-09-27 13:46:52] cheatah at tweakers dot net

When using the setcookie function, I noted that setting the value to
NULL had the following result:

The expire time argument was completely ignored, and automatically set
to one year and one second ago. Also the value sent to the browser for
this cookie had changed to 'deleted'.

I browsed the PHP source code, and saw my suspicions confirmed, this is
the correct behaviour.
Could this be included in the documentation? I really like the
following syntax:

setcookie('name', null, null, '/');


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=19638&edit=1

Reply via email to