using the below code i used to check whether the user is logged in or not
if(!$this->session->userdata['logged_in'])
{
redirect("gt_login");
}
else
{
}
but this code is only working in localhost while i put this into server it shows error like this

this is where i load session library
function __construct() { parent::__construct(); $this->load->library('session'); $this->load->database(); $this->load->helper('url'); $this->load->helper('form'); $this->load->model('gt_home_content_model'); if(!$this->session->userdata['logged_in']) { redirect("gt_login"); } else { } }
i am not much familiar to codeigniter and also is there any other method to do this can any one suggest me to do that ....
if(!$this->session->has_userdata['logged_in']['username'])try hope it will works.