Exodious
01-17-2004, 12:53 PM
Hiya,
I've added the header("Location: http://wheretoforward"); to my security class whereas before I was using javascript to forward, and now my serialized session object is null, anyone know why? or will I be forced to use javascript instead?
Saving the object
# save this object on the session
$_SESSION["securityObj"] = serialize($this);
#$this->makeJavaScriptStr();
header("Location: http://".$_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) ."/cm/");
Restoring the object on another page
$sObj = unserialize($_SESSION["securityObj"]);
print "<br>type of securityObj: " . gettype($_SESSION["securityObj"]);
print "<br>Test variable, getUserLoginName(): " . $sObj->getUserLoginName();
If I don't use the header("location: etc...") and use javascript window.location.href = "some place"; then the object is restored without problems and I can access all its members and properties, yet using the header method to forward users results in the object being Null. :confused:
Any ideas welcome
I've added the header("Location: http://wheretoforward"); to my security class whereas before I was using javascript to forward, and now my serialized session object is null, anyone know why? or will I be forced to use javascript instead?
Saving the object
# save this object on the session
$_SESSION["securityObj"] = serialize($this);
#$this->makeJavaScriptStr();
header("Location: http://".$_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) ."/cm/");
Restoring the object on another page
$sObj = unserialize($_SESSION["securityObj"]);
print "<br>type of securityObj: " . gettype($_SESSION["securityObj"]);
print "<br>Test variable, getUserLoginName(): " . $sObj->getUserLoginName();
If I don't use the header("location: etc...") and use javascript window.location.href = "some place"; then the object is restored without problems and I can access all its members and properties, yet using the header method to forward users results in the object being Null. :confused:
Any ideas welcome