if($this->session->unset_userdata('logged_id'){ $this->session->set_flashdata('usuario_logout', etc..) redirect...}