What is $this->session->userdata('logged_in') value? Have your dump $_SESSION? You can set session userdata by using $this->session->set_userdata('some_name', 'some_value'). The userdata() method returns NULL if the item you are trying to access does not exist.
Keep calm.