i'm trying to check if a user is logged in or not then i wan't to check if he is an admin or not if not then redirect it to login page but it ain't working
// Access control
if (!$this->session->userdata('logged_in') ) {
if(!$this->session->userdata('user_rol') == 'Administrator'){
$this->session->set_flashdata('error_msg','Please login as an admin first!');
redirect('admin/login');
}
}
Any help please ??