I'm writing my own session handler and some of it is based off of CodeIgniters session handler. global_registered is set to off and this part of my class:
protected $userdata = array();
//in the initialization of the class after the session start i call
$this->userdata =& $this->get_userdata();
public function &get_userdata()
{
// Just return reference to $_SESSION
return $_SESSION;
}
public function userdata($item)
{
return isset($this->userdata[$item]) ? $this->userdata[$item] : NULL;
}
public function unset_userdata($newdata = array())
{
// Wrap single name as array
if (is_string($newdata))
{
$newdata = array($newdata => '');
}
// Unset each item name
if (count($newdata) > 0)
{
foreach (array_keys($newdata) as $key)
{
unset($this->userdata[$key]);
}
}
}
The unset is not working. I read a bit on php about unset and issues with functions but it wasn't clear to me on how to unset something within a funcation with globals off
Since I'm not allowed to comment: Do you have session_start() some place else?
Sorry, this issue was NOT php or codeigniter but the file system not truncating properly. Thanks:)