php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18168 setcookie() only sets last call
Submitted: 2002-07-04 14:20 UTC Modified: 2002-07-15 20:44 UTC
Votes:5
Avg. Score:5.0 ± 0.0
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:2 (40.0%)
From: robschiffman at imaginaworld dot com Assigned:
Status: Closed Package: Apache2 related
PHP Version: 4CVS-2002-07-04 OS: Windows 2000 Server
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
31 - 16 = ?
Subscribe to this entry?

 
 [2002-07-04 14:20 UTC] robschiffman at imaginaworld dot com
Calling setcookie multiple times only sets the last cookie "second".

setcookie.php:

<?
setcookie("first","1");
setcookie("second","2");
?>

show results:

use javascript:alert(document.cookie); in URL to verify.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-04 14:51 UTC] sniper@php.net
Exactly what version of PHP you have? (look that in phpinfo() output) And apache2?


 [2002-07-04 15:59 UTC] robschiffman at imaginaworld dot com
PHP Version: 4.2.2-dev
Apache Version: 2.0.39
 [2002-07-04 16:17 UTC] sniper@php.net
AFAIK, if you use the latest CVS HEAD of PHP and Apache, this will work.

 [2002-07-04 16:40 UTC] robschiffman at imaginaworld dot com
My version is latest STABLE from http://snaps.php.net/win32/
which I'm assuming is the most recent build from CVS, correct?
 [2002-07-04 16:52 UTC] sniper@php.net
No, it's not the latest. The snapshots without 'stable' text in them are. (and with text 'latest').

But unfortunately the binary snapshots are not build
with latest Apache2 so..

 [2002-07-15 20:44 UTC] sniper@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 14:01:29 2024 UTC