CI 3.x extending Session class, _parent not set |
I have extended the session class as follows:
PHP Code: require_once(BASEPATH . 'libraries/Driver.php'); I load the session driver with PHP Code: $this->load->driver('tho/CodeIgniter/CodeIgniterSession'); 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)); A bug? Or am I doing something wrong?
The Session class will be swapped with a new one, as far as I know. When this happens all you try here will get broken.
@ivantcholakov: Thanks for the warning. I don't have too much in my extended session class so it should be easy to modify (hopefully)
@Mohammadhzp: I could not find much about extending drivers. CI2 has very little information, and neither does CI3. Found some more on stackoverflow... I decided to just use the CI2 Session library for now and extend it as I have done it when using CI2. I will have to look into the CI3 session driver once it is more mature I guess. |
Welcome Guest, Not a member yet? Register Sign In |