Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.7.0
-
Fix Version/s: 0.8.0
-
Component/s: Zend_Session
-
Labels:None
Description
-------- Original Message --------
Subject: [fw-auth] Problem with Zend Session and setting arrays
Date: Thu, 18 Jan 2007 07:00:40 -0800 (PST)
From: Daniel Schwip. (Germany) <ds@ms-computerservice.com>
To: fw-auth@lists.zend.com
Hi there,
if i set a session property to an array and later add a new key, it won't be
set. I think it's because of the __set php implementation???
—
$session = new Zend_session();
$session->array = array();
$session->array['testKey'] = 1;
Zend::Dump($session->array, 'sessArray'); // testKey is not set
// My Current workaround
$session->array = array_merge($session->array, array('testKey' => 1));
Issue Links
| This issue is related to: | ||||
| ZF-1743 | Zend_Session_Namespace does not persist new slice data |
|
|
|
Oddly, I found setting additional keys in the array works, with only the first one "ignored" by PHP.
The problem certainly appears related to PHP and not Zend_Session.
Thus, a temporary workaround for the code above:
$session->array['dummy''] = true; $session->array['testkey'] = 1;$ php -v
PHP 5.1.6 (cgi-fcgi) (built: Oct 24 2006 19:38:28)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
$ svn update
uname At revision 3015.
$ uname -a
Linux sandbox.zend.com 2.6.9-34.EL #1 Fri Feb 24 16:44:51 EST 2006 i686 i686 i386 GNU/Linux
$session->array['dummy''] = true; $session->array['testkey'] = 1;