The PHP documentation says \"You can\'t use references in session variables as there is no feasible way to restore a reference to another variable.\"
Does this mean
For safe serialization and unserialization encode and decode with base64_encode() and base64_decode() respectively. Below I pass a serialized Object to a session and unserialize it on the other page to regain the variable to an object state.
Page 1
setUserRegData();
$reg_serlizer = base64_encode(serialize($registrationData)); //serilize the object to create a string representation
$_SESSION['regSession'] = $reg_serlizer;
?>
Page 2
firstName;
?>
This article describes issues that may be faced by not doing so. issuses with php serialization/unserialization