[eluser]sneakyimp[/eluser]
I recommend that you write a class to extend CI_Controller and in the constructor of this class, you put your session check. Something like this:
Code:
/**
* A controller specific my web applications that will force
* authentication before granting access
*/
class My_Controller extends CI_Controller {
function __construct() {
parent::__construct();
// check login here
if (!$this->native_session->get(‘IdUsuario’)){
redirect(‘acceso_usuario’, ‘refresh’);
}
} // __construct()
} // class My_Controller
Then instead of having your controllers extend CI_Controller, have them extend My_Controller. You may have a bit of trouble getting code igniter to find your class. You may also need to work on that a little to make sure you've loaded your native_session module.