[thelist] PHP cookie help pleeeease

Means, Eric D eric.d.means at boeing.com
Wed Jun 12 14:43:01 CDT 2002


>  -----Original Message-----
> From: 	Mike Stevens [mailto:mstevens at members.evolt.org]
> Sent:	Wednesday, June 12, 2002 5:34 PM
> To:	thelist at lists.evolt.org
> Subject:	[thelist] PHP cookie help pleeeease
>
> Line 47 of auth.php is this: setcookie("cookieName","","","/","",0);

>From http://www.php.net/manual/en/function.setcookie.php:
int setcookie ( string name [, string value [, int expire [, string path [,
string domain [, int secure]]]]])

The 3rd parameter is intended to be the Unix-style time at which the cookie
expires; I generally use time() + 86400 * 365 (one year from "now").  Since
"" isn't a valid integer value, PHP is unhappy about it.  As noted in the
above linked page:

The expire and secure arguments are integers and *cannot be skipped with an
empty string*. Use a zero (0) instead. The expire argument is a regular Unix
time integer as returned by the time() or mktime() functions.
 (emph. added)



More information about the thelist mailing list