Reading the value of a serialize object in session
| From: | py | Date: | Mon, 26 Nov 2001 06:32:18 +0000 |
| Subject: | Reading the value of a serialize object in session | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-75700@lists.php.net to get a copy of this message | ||
Hello,
How do you read back the value of a serialize object that you put into a
session variable?
My exemple:
page1.php
---------------
session_start();
include( "myObject.php" );
$o = new myObject();
$o->load_variable( "100", www.domain.com);
$o = serialize( $o );
session_register( "o" );
Header("Location:page2.php");
exit;
page2.php
---------------
session_start();
include( "myObject.php" );
print $HTTP_SESSION_VARS['o']; // prints the line ok
print "<br>". $o->var1; // nothing...
print "<br>". $o->var2;
It does not work event when I do $o = unserialize( $o ) before displaying..
py