CodeIgniter Forums
Cant extend Session library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Cant extend Session library (/showthread.php?tid=41254)



Cant extend Session library - El Forum - 05-03-2011

[eluser]Nekluh[/eluser]
Hi!

I'm converting to the latest codeigniter 2.02 and suddenly I can't extend the Session library.

I have the MY_Session.php in the /core/ folder and it looks like this

Code:
class MY_Session extends CI_Session {

    function __construct()
    {
        parent::__construct();
        echo "In extended session";
    }
}

I can extend the Controller and Model class without any problems.
Does anybody have the same problem? Ideas?


Cant extend Session library - El Forum - 05-03-2011

[eluser]Nekluh[/eluser]
I found the problem!
The file should be placed in the Library folder, not the Core folder.


Cant extend Session library - El Forum - 05-03-2011

[eluser]InsiteFX[/eluser]
Very simple!

If the library you are extending is in the system/core then your extended library goes into application/core.

If the library you are extending is in the system libraries then your extended library goes into application/libraries.

InsiteFX