class cookie{
var $cookie;
var $key;
var $name = 'information';
var $time = 0;
var $loc = '/';
var $limit = 5000;
function cookie(){
$this->key = $this->name;
if(get_magic_quotes_gpc()){
$cookie = stripslashes($_COOKIE[$this->key]);
}else{
$cookie = $_COOKIE[$this->key];
}
$this->cookie = unserialize($cookie);
}
function add($name, $value){
$this->cookie[$name] = $value;
}
function burn(){
$serialized = serialize($this->cookie);
if(strlen($serialized) > $this->limit){
return false;
}else{
setcookie($this->key, $serialized, $this->time, $this->loc);
return true;
}
}
function getCookie($name){
return $this->cookie[$name];
}
function removeCookies(){
setcookie($this->key);
//setcookie($this->key, time()-3600);
}
}