[eluser]rogierb[/eluser]
I dont think its a bug. Your using an extension to My_Controller which is an extension to CI_Controller.
This might be the problem. It looks like this is creating a new object and a new session
As far as I kno the hooks get processed outside the CI superobject (see core/CodeIgniter.php).
If you want to use the superobject you need to use $this->CI = get_instance();
I would do something like:
Code:
class Tracker {
var $CI;
public function __construct()
{
$this->CI = get_instance();
}
/* DATABASE ___________________________________________________________________________________ */
function track_actions()
{
// Fetch items
$track_items = $this->CI->config->item('tracker_items');
// Anything to track?
if(count($track_items) > 0 && $track_items != "")
{
// Insert into log
foreach($track_items as $item)
{
// Flush between inserts
$this->CI->db->flush_cache();
// Insert
$this->CI->db->insert('tracking', array(
'action' => $item['action'],
'comment' => $item['comment'],
'date' => date('Y-m-d H:i:s'),
'user_id' => $this->CI->session->userdata('user_id')
));
}
}
}
}
This way your staying inside the original CI object and not creating a new one when extending the class