|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-12-05 02:59 UTC] gavin at vess dot com
[2006-12-05 09:58 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 09 09:00:01 2025 UTC |
Description: ------------ php seems to fail to check if there is already a setcookie for the session in the queue and puts the same thing in again Reproduce code: --------------- <?php ob_start(); session_start(); $id = session_id(); $_SESSION['asdf'] = 123; var_dump($_SESSION); session_write_close(); $_SESSION['asdff'] = 234; var_dump($_SESSION); session_start($id); $_SESSION['a'] = 'b'; var_dump($_SESSION); session_write_close(); var_dump($_SESSION); Expected result: ---------------- X-Powered-By: PHP/5.2.1-dev Set-Cookie: PHPSESSID=h00e0fl7o9ilgifoluqh8kdbg1; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-type: text/html array(1) { ["asdf"]=> int(123) } array(2) { ["asdf"]=> int(123) ["asdff"]=> int(234) } array(2) { ["asdf"]=> int(123) ["a"]=> string(1) "b" } array(2) { ["asdf"]=> int(123) ["a"]=> string(1) "b" } Actual result: -------------- X-Powered-By: PHP/5.2.1-dev Set-Cookie: PHPSESSID=h00e0fl7o9ilgifoluqh8kdbg1; path=/ Set-Cookie: PHPSESSID=h00e0fl7o9ilgifoluqh8kdbg1; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-type: text/html array(1) { ["asdf"]=> int(123) } array(2) { ["asdf"]=> int(123) ["asdff"]=> int(234) } array(2) { ["asdf"]=> int(123) ["a"]=> string(1) "b" } array(2) { ["asdf"]=> int(123) ["a"]=> string(1) "b" }