Follow the ALex recommendations, but using the CI code :). What I mean, try to parse each session information separately. I read once about the problem in version 2.0.3, I think, but now I donโt remember, and I donโt have time to look for the link. This is on their forum, however, and the same thing: unset each element of the session one after another.
$this->session->unset_userdata('data_one'); $this->session->unset_userdata('data_two'); $this->session->unset_userdata('data_three'); $this->session->unset_userdata('data_one'); $this->session->sess_destroy(); redirect('home','refresh');
You need to redirect because a CI session is just cookies, not a native array of php sessions.
One more thing ... make sure the error is not in your login methods, which logs you in whether or not you log out successfully!
source share