Hi,
Am working on hooks wit codeigniter, am getting an error after applying hooks like "This webpage has a redirect loop".
My hooks.php file :
$hook['post_controller_constructor'] = array(
'class' => 'SessionData',
'function' => 'initializeData',
'filename' => 'auth.php',
'filepath' => 'hooks',
'params' => array()
);
auth.php file:
<?php
class SessionData{
var $CI;
function __construct(){
$this->CI =& get_instance();
if(!isset($this->CI->session))
$this->CI->load->library('session');
}
function initializeData() {
if(!$this->CI->session->userdata('admin_id')){
redirect('admin');
}
}
}
?>
Why am getting this error? Please help.
Thanks