ID:          23835
 Updated by:  [EMAIL PROTECTED]
 Reported By: kruemelmonster at cookiecan dot de
 Status:      Open
 Bug Type:    Documentation problem
 PHP Version: 4.3.2RC4
 New Comment:

Linking to the RFC instead of the Netscape docs would be wrong, because
PHP implements the Netscape version and not RFC 2109 or RFC 2965.
And if the PHP Manual says you pass the expires argument as an integer,
and the netscape docs say the expires attribute is a RFC822 Date
String, it's imho obvious that it gets autoconverted. Maybe "specifics"
should be changed into "internals", if you think that is more
appropriate...


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

[2003-05-27 14:22:57] [EMAIL PROTECTED]

The text says: "The following table explains each parameter of the
setcookie() function, be sure to read the Netscape cookie specification
 for specifics." Then the table says that the user need to use an
integer for the time. That is inconsistent. As there is no note that
the time is converted automatically.

Linking to the RFC instead of the Netscape docs is also more
"standard".

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

[2003-05-27 12:59:29] [EMAIL PROTECTED]

The documentation tells the user correctly how to use setcookie().
IMHO, he doesn't need to know about RFC822 dates - in fact, it doesn't
help him at all. I'm not against adding a note in the manual page, but
i consider it unneccessary, especially since the netscape document
which states that the time in the header is a RFC822 date string is
linked for those who are interested in the internals, but the average
PHP user is not.

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

[2003-05-27 12:23:55] [EMAIL PROTECTED]

I don't agree that this is not a bug. The reference refers that the
netscape info, and there the expiration date is a string. This
time->string conversion is done by PHP however. This is not documented.
Also some links to the new RFCs would be good. They are more official
then the Netscape docs. Even if we don't support all of the options
fully.

BTW the question that the setcookie function needs a maxage paramater
is a feature request, please open another bug as a feature request for
that.

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

[2003-05-27 12:11:34] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The parameter you pass to setcookie() as a timestamp gets converted to
a date as specified by the rfc automatically. And there is nothing
wrong with using the netscape specification, it is supported by the
broadest range of browsers.

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

[2003-05-27 11:25:56] kruemelmonster at cookiecan dot de

the documentation of setcookie() suffers major inconsistencies.


from the setcookie() man page:

--------------------------------------------
expire:
The time the cookie expires. This is a unix timestamp so is in number
of seconds since the epoch. In otherwords, you'll most likely set this
with the time() function plus the number of seconds before you want it
to expire. Or you might use mktime(). 
--------------------------------------------

refers to the old netscape-spec
http://www.netscape.com/newsref/std/cookie_spec.html 
which clearly states: 

--------------------------------------------
expires=DATE 
The expires attribute specifies a date string that defines the valid
life time of that cookie. Once the expiration date has been reached,
the cookie will no longer be stored or given out. 
The date string is formatted as: 

Wdy, DD-Mon-YYYY HH:MM:SS GMT
This is based on RFC 822, RFC 850, RFC 1036, and RFC 1123,... [snip]
--------------------------------------------

unix_ts <?> datestring?    what gives?

please also consider the new specs published by the ietf:
http://www.ietf.org/rfc/rfc2109.txt
http://www.ietf.org/rfc/rfc2965.txt 
as posted by a user, implementing 'max-age'. 
 
either remove the explanation completely or correct it with a list of
the type:

expires:
   - unix_ts
   - datestring
and you might want to include max_age


thanx



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


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


-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to