0
我目前使用Codeigniter 3.1.2和Ion Auth。我可以登錄並查看我的儀表板頁面,但是如果我嘗試查看另一個需要用戶登錄的頁面,例如客戶頁面,我總是被重定向到登錄頁面。Ion Auth + Codeigniter logged_in總是重定向到登錄
控制器
public function __construct(){
parent::__construct();
$this->load->library('form_validation');
$this->load->library('session');
$this->load->helper('form');
$this->load->helper('url');
$this->load->model('CRUD');
if (!$this->ion_auth->logged_in()) {
redirect('User/index');
}
}
public function index(){
$this->load->helper('form');
$this->load->view('login');
}
public function dashboard(){
$this->load->view('dashboard');
}
public function customerPage(){
$data['customer'] = $this->CRUD->getCustomers();
$this->load->view('customer', $data);
}
public function materialPage(){
$data['material'] = $this->CRUD->getMaterials();
$this->load->view('material', $data);
}
感謝, CHTRK