Hi,
I get an error when i try to echo my cookie. Notice: unserialize() [function.unserialize]: Error at offset 0 of 12 bytes in...
I cannot find a solution. Help please.
Thanks
class MyCookie {
public function __construct($cookieName, $sessionId) {
if(! isset($_COOKIE[$cookieName])) {
$cookieValue["SESSION"] = $sessionId;
setcookie($cookieName, $cookieValue, time()+60*60*24*7);
}
}
public function fetchMe($cookieName) {
$value = unserialize(stripslashes($cookieName));
echo "<pre>";
print_r($value);
}
}
$mycookieObj=new MyCookie("myname", "testtest123");
$mycookieObj->fetchMe("myname");