<?php
/**
 * OSA_Session.php - Overrides the system Session class to support object
 *    storage. If CodeIgniter starts to support object storage we can simply
 *    remove this file and no need to change any source code.
 *
 * @author $Author: dtong $
 * @version $Id: Osa_Session.php,v 1.5 2011/02/11 09:09:27 dtong Exp $
 * @copyright Copyright (c) 2009, Tiller Software Co., Ltd.
*/

class Osa_Session extends CI_Session {
	function __construct($params=array()) {
		parent::__construct($params);
   }

   function set_userobject($newdata, $newval = '') {
	   $newval = serialize($newval);
   	return parent::set_userdata($newdata, $newval);
   }

   function userobject($item) {
   	$data = parent::userdata($item);
   	if ( $data )
   		return unserialize($data);
   	return FALSE;
   }
}
?>