I have serialized an object and "added" it in a cookie. when i try to unserialize the object to a variable and call the gettype function i get as output "boolean". This is the code for unserialize:
Code: Select all
$connection = $HTTP_COOKIE_VARSї'login'];
$oracle = unserialize($connection);
echo gettype($connection)."<BR>".gettype($oracle);
the output is:
string
boolean
The code for serializing the object is the following:
Code: Select all
$connection = serialize($oracle);
if (setcookie("login", $connection)){
header("Location: search.php");
}
What is wrong with unserialize? I saw the manual of php and it didn't mention that returns a boolean!!!!!!! And why should return a boolean in the first placE?!?!?!?!?! Please help me with that