Bug #16800 Updated: problem with registration an array variable in session
| From: | postings dot php dot net at hans-spath dot de | Date: | Wed, 24 Apr 2002 17:44:21 +0000 |
| Subject: | Bug #16800 Updated: problem with registration an array variable in session | ||
| References: | 1 | Groups: | php.bugs php.doc |
| Request: | Send a blank email to php-bugs+get-5853@lists.php.net to get a copy of this message | ||
ID: 16800
Updated by: postings.php.net@hans-spath.de
Reported By: comsoso@comail.ru
Status: Open
Bug Type: Documentation problem
Operating System: linux
PHP Version: 4.1.2
New Comment:
@ daniel@php.net:
I hope that should be a bad joke ...
I've tested the code below with 4.1.1 and it worked.
(session support is broken in 4.1.2 AFAIK)
$bar = array(
'something' => array( 1,2,3,4 ),
'nothing' => NULL,
'test' => true,
'test2' => array( 'x','y'=>2 )
);
session_register('bar');
Previous Comments:
------------------------------------------------------------------------
[2002-04-24 12:49:19] daniel@php.net
I made it a documentation problem. The manual page for
'session_register()' should explicitly mention this.
------------------------------------------------------------------------
[2002-04-24 12:47:56] daniel@php.net
arrays can't be registered in sessions. However, you can store a
serialized array:
$arr = serialize($array);
session_register($arr);
-daniel
------------------------------------------------------------------------
[2002-04-24 12:46:52] derick@php.net
The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit http://www.php.net/support.php
------------------------------------------------------------------------
[2002-04-24 12:28:56] comsoso@comail.ru
I've tried to register a seesion variable $array[$i] with
sessionn_register(), where $i is an integer index, but failed. In a
temporary session file in my /tmp directory I found a declaration like
!array[0]|, and now values.
Please help! Thanks
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16800&edit=1