ID: 16626 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Apache2 related Operating System: RedHat 7.2 (kernel 2.4.18) i386 PHP Version: 4.2.0 New Comment:
I can confirm that the replacement function for setcookie by [EMAIL PROTECTED] (send_htCookie) just sets the last cookie in the HTTP response header on my system Previous Comments: ------------------------------------------------------------------------ [2002-04-24 14:13:58] [EMAIL PROTECTED] I filed bug #16803 to expand on the header() problem. ------------------------------------------------------------------------ [2002-04-24 13:54:39] [EMAIL PROTECTED] Now I know what "don't use this on a production server" means. :) Strangely, this bug also seems to affect header(). As a result of this bug, we replaced setcookie() with our own routine to write out cookies via header(). However, still, only one cookie (the last one) is being printed in the HTTP response headers (when I sniff the packets being sent). It's very strange... Here's the code we used to replace setcookie(). function send_htCookie() { $vars=array('varname','varval','expire','path','domain','secure'); for ($i=0;$i<func_num_args();$i++) { ${$vars[$i]}=func_get_arg($i); } if (!$varname) { return false; } $COOKIE = "Set-Cookie: $varname=$varval"; if (isset($expire)) { $COOKIE .= "; EXPIRES=$expire";} if (isset($domain)) { $COOKIE .= "; DOMAIN=$domain"; } if (isset($path)) { $COOKIE .= "; PATH=$path"; } if (isset($secure) && $secure>0) { $COOKIE .= "; SECURE"; } header($COOKIE); return true; } Can anyone confirm that this, too, doesn't work for them? I'll do more testing in the meantime... ------------------------------------------------------------------------ [2002-04-23 09:56:19] [EMAIL PROTECTED] I get the same problem on FreeBSD 4.5 with Apache 2. ------------------------------------------------------------------------ [2002-04-23 04:22:00] [EMAIL PROTECTED] Bug reproduced with 4.2.0 ------------------------------------------------------------------------ [2002-04-16 16:37:10] [EMAIL PROTECTED] Same problem as BUG# 16631. (Problem also with RC2 and RC3 of 4.2.0) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/16626 -- Edit this bug report at http://bugs.php.net/?id=16626&edit=1