php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38642 array_merge and $_SESSION do not play well
Submitted: 2006-08-29 14:17 UTC Modified: 2006-11-29 22:06 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: sp0n9e at gmail dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 5.2.0RC2 OS: Windows
Private report: No CVE-ID: None
 [2006-08-29 14:17 UTC] sp0n9e at gmail dot com
Description:
------------
On linux, this code runs perfectly fine and as expected, on windows, it seems that session_write is not called at all or given null params.

Reproduce code:
---------------
<?php
session_set_save_handler('var_dump','var_dump','var_dump','var_dump','var_dump','var_dump');
session_start();
$_SESSION['foo'] = "bar";
$_SESSION = array_merge($_SESSION,array('foo'=>'foo','bar'=>'bar'));
session_write_close();
var_dump($_SESSION);
?>

Expected result:
----------------
Warning: Wrong parameter count for var_dump (i believe triggered by session_close callback) and a dump of the session id and serialized session data.  On both the expected and non-expected results, var_dump shows the expected array structure.

Actual result:
--------------
1 wrong parameter count for var_dump given by the session close callback, and nothing else concerning session write callback.  However, the var_dump of $_SESSION shows the correct array structure.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-29 22:06 UTC] tony2001@php.net
See bug #39496.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 18:01:32 2024 UTC