#24202 [Bgs]: problem with array of objects stored in session vars

From: Date: Mon, 16 Jun 2003 15:33:17 +0000
Subject: #24202 [Bgs]: problem with array of objects stored in session vars
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-42049@lists.php.net to get a copy of this message
ID: 24202 Updated by: sniper@php.net Reported By: admin at nexusfor dot com Status: Bogus Bug Type: Session related Operating System: WIN NT PHP Version: 4.3.2 New Comment: It's not a suggestion, it's requirement. session.auto_start has to be OFF if you want to store objects in sessions. Previous Comments: ------------------------------------------------------------------------ [2003-06-16 10:31:38] admin at nexusfor dot com thank you for the suggestion. ------------------------------------------------------------------------ [2003-06-16 10:25:45] sniper@php.net From the Friendly Manual: "If you do turn on session.auto_start then you cannot put objects into your sessions since the class definition has to be loaded before starting the session in order to recreate the objects in your session." ------------------------------------------------------------------------ [2003-06-16 10:14:23] admin at nexusfor dot com I'm lazy man so I set session.auto_start = 1 in my php.ini :-) I also tried with explicit session_start(), the problem persists. session serialiazation seems to works fine here the tmp file: SESS|a:2:{i:0;O:5:"bogus":1:{s:1:"a";s:1:"1";}i:1;O:5:"bogus":1:{s:1:"a";s:1:"1";}} Today is just an horrible monday for me, but I'm sure that there is something strange and I don't think that problem is in the script. the code works fine in your environment ? ------------------------------------------------------------------------ [2003-06-16 09:55:54] derick@php.net doh! You forgot session_start() everywhere... ------------------------------------------------------------------------ [2003-06-16 09:40:51] admin at nexusfor dot com second source correction: <? $b = $HTTP_GET_VARS["b"]; $_SESSION ["SESS"] = array_merge ($_SESSION ["SESS"], array ($b) ); print_r ($_SESSION ["SESS"]); reset ($_SESSION ["SESS"] ); $i = 0; while (list ($key, $val ) = each ($_SESSION ["SESS"] ) ) { echo $val; } ?> sorry for the mistake ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/24202 -- Edit this bug report at http://bugs.php.net/?id=24202&edit=1

« previous php.bugs (#42049) next »