CI 3.x extending Session class, _parent not set - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19) +--- Thread: CI 3.x extending Session class, _parent not set (/showthread.php?tid=670) |
CI 3.x extending Session class, _parent not set - tho - 01-03-2015 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? RE: CI 3.x extending Session class, _parent not set - ivantcholakov - 01-04-2015 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. RE: CI 3.x extending Session class, _parent not set - tho - 01-04-2015 @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. |