PHP 4.0 Bug #6424 Updated: SetCookie with array

From: Date: Wed, 01 Nov 2000 16:05:46 +0000
Subject: PHP 4.0 Bug #6424 Updated: SetCookie with array
Groups: php.dev 
Request: Send a blank email to php-dev+get-36666@lists.php.net to get a copy of this message
ID: 6424 Updated by: sniper Reported By: nbhanji@home.com Status: Feedback Bug Type: *General Issues Assigned To: Comments: Does this still happen when using PHP4.0.3pl1? --Jani Previous Comments: --------------------------------------------------------------------------- [2000-08-29 19:42:32] nbhanji@home.com I have similar problem: I am using php 4.0.1 pl 2, and redhat 2.2.16 with mysql 3.23.xx. My problem is that I am losing some values when I set cookie using array. for example: in file: loginAction.php setcookie ("s_cookie[0]","0",time()+3600,"/"); setcookie ("s_cookie[1]","1",time()+3600,"/"); setcookie ("s_cookie[2]","2",time()+3600,"/"); setcookie ("s_cookie[7]","7",time()+3600,"/"); in file: nSessionAction.php setcookie ("s_cookie[3]","3",time()+3600,"/"); setcookie ("s_cookie[4]","4",time()+3600,"/"); setcookie ("s_cookie[5]","5",time()+3600,"/"); setcookie ("s_cookie[6]","6",time()+3600,"/"); updateUserSession($s_cook); in file: functions.php function updateUserSession($s_cook){ for($index=0;$index< count($s_cook);$index++){ echo $s_cook[$index] . "x"; } } The output I get is as follows: run #1: 0x1x2xx4xxxx run #2: 0x1x2x3xxxxx run #3: 0x1x2xxxxx0x output changes randomly, though the order of loosing is similar after shutting down the browser and starting it again. This happens on both Netscape 4.74 and IE 5.0. in IE5 for mac, I can see the cookies are in right order and have right values. I have followed the example in php professional programming. --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=6424

« previous php.dev (#36666) next »