I\'m doing a validation in my constructor which checks whether the user has started a session.
I\'m then throwing in some controllers for various things.
My
As stated earlier why don't you use separate different base controllers for specific purpose.
I would suggest as this way for you
let us take two part one let's say frontend controller which donot require session and another controller let's say backend controller which needs session Now,
//application/core/Front_controller.php
class Front_Controller extends MY_Controller
{
function __construct()
{
parent::__construct();
}
}
another class under core/backend_controller
class backend_Controller extends MY_Controller
{
function __construct()
{
parent::__construct();
$this->load->library('session');
}
}
now you can extend the front_controller for those controller you do not need session and extend backend controller which requires session from application/controller