If you are using sessions and use session_register() to register objects, these objects are serialized automatically at the end of each PHP page, and are unserialized automatically on each of the following pages. This basically means that these objects can show up on any of your pages once they become part of your session.
You don’t need to serialize an object before adding it to a session var
example:
<?php include("class.exmaple.php");
$obj = new exampel ();
$_SESSION['obj']=$obj;?>
and to resume the object:
<?php include("class.example.php");
$obj = $_SESSION['obj']); ?>
Leave a Reply
You must be logged in to post a comment.
Recent Comments