Getting an object from a session variable.
Posted on 2006-05-21
I have the following:
$newOwner = new Owner();
$newOwner = $_SESSION['NewOwner'];
Is this the right way to get an object from a session variable?
I have just read something saying that there is no need to serialise/unserialise session vars, is this correct?
also once the data on this owner is collected it is posted to a php page that populates an owner object and I then want to set the object to a session var of the same name as this one i.e NewOwner.
At the mo on this page I have:
where $owner is my populated class.
Could someone give me some pointers as to how to set the NewOwner session var if this is incorrect.
Thanks in advance.