setcookie ( string name [, string value [, int expire [, string path [, string domain [, int secure]]]]])
Well, if I take off the "string domain" part, it will work just fine. The problem is that I can't use the "int secure". No biggy right now, but I might want to do that in the future. So the following works just fine now:
setcookie("aa_host",$cookhost,'0','/');
Can anybody explain this now? BTW, I put on an actual domain name to my laptop and put that domain name in the "string domain" parameter and it still didn't work.
Steve
At 05:53 PM 7/31/2003 -0500, Steve Buehler wrote:
I still can't figure something out. I am using WinXP/Apache 1.3.24/PHP 4.2.3 on my laptop and my cookies still don't work like they should. Hopefully someone can explain to me why.
<?
$cookhost=$_SERVER["HTTP_HOST"];
header("Set-Cookie: aa_host=$cookhost;");
setcookie ("aa_host", "$cookhost",0,"/","$cookhost");
setcookie ("aa_host", "localhost",0,"/","localhost");
setcookie ('aa_host', 'localhost',0,'/','localhost');
?>
I can set the cookie with the "header" line with no problem, but either one of the "setcookie" lines will not set the cookie. Has anybody seen this? Does anybody know why this might be happening? BTW, no, I do not try to set all of these at once. Just showing the lines that I use. The "header" line and the first two "setcookie" lines work just fine on a RedHat 7.3/Apache 1.3.27/PHP 4.2.2 machine.
Thanks Steve
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php