Welcome Guest, Not a member yet? Register   Sign In
CI 3.x extending Session class, _parent not set
#1

I have extended the session class as follows:

PHP Code:
require_once(BASEPATH 'libraries/Driver.php');
require_once(
BASEPATH 'libraries/Session/Session.php');
require_once(
BASEPATH 'libraries/Session/drivers/Session_cookie.php');

class 
CodeIgniterSession extends CI_Session_cookie 

I load the session driver with
PHP Code:
$this->load->driver('tho/CodeIgniter/CodeIgniterSession'); 
and right after I try to remove userdata with
PHP Code:
$this->codeignitersession->unset_userdata('order_code'); 

However, this gives me the error
Quote:Fatal error: Call to a member function select_driver() on a non-object in /home/tho/Projects/Webdesign/Codeigniter 3 system/libraries/Session/Session.php on line 703

On line 703, there is the code
PHP Code:
$this->_parent->select_driver(get_class($this)); 
and it seems that _parent is NULL. I figured out that _parent is set through decorate(), but I couldn't figure out so far when decorate is/should be called. Adding a simple echo into the decorate function did not give me any output, which makes it seems that decorate is never called...

A bug? Or am I doing something wrong?
Reply


Messages In This Thread
CI 3.x extending Session class, _parent not set - by tho - 01-03-2015, 07:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB