[eluser]Nick_MyShuitings[/eluser]
I don't believe that you do. If you call $this->session->unset_userdata('session_id'); that should take care of the DB if you are using the db for your sessions.
[eluser]Nick_MyShuitings[/eluser]
hmmm... if that is not set, then how does that logout function work... since it would return a false if the index didn't exist.
Have you tried checking how the main auth libraries do it? tank? ion? redux etc?
[eluser]ignitian[/eluser]
Actually $this->session->sess_destroy(); dont delete the record in the ci_sessions table, it only unset user_data field and keep the session_id record.
I guess that is correct. It keep session alive until timeout setting.
So when the user logs out you can just call $this->session->sess_destroy(); in your controller. Right at the end. Just remember one thing. If you log the user out and destroy his session and then redirect them to another page and have sessions auto-loading, another session will be created.