The 3rd parameter is an optional time to expire parameter, if you don't want to set 
it, leave it out.  setcookie(cookiename,"value");  works fine

----- Original Message -----
From: Lazor, Ed
Sent: Saturday, June 15, 2002 11:48 AM
To: php-general
Subject: [PHP] Can't set a cookie?

Hi Everyone,

Any idea why I'm getting this error?

Warning: setcookie() expects parameter 3 to be long, string given in *my
script* on line 2

Here's the entire script generating the error:

setcookie("mytest", 1, "", "/");

The script doesn't work on a new hosting service I subscribed to, but it
works on two other servers - 1 linux and 1 windows, both with Apache 1.3.24.
I'm looking for what version the hosting service is using... their support
page says "PHP4 with Zend Optimizer".  The other two servers are using PHP

Any ideas of what's going on?


This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very

PHP General Mailing List (
To unsubscribe, visit: more from the Web.  FREE MSN 
Explorer download :

Reply via email to