CodeIgniter Forums
Multiple sessions in DB - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Multiple sessions in DB (/thread-58413.html)



Multiple sessions in DB - El Forum - 06-10-2013

[eluser]mabright[/eluser]
I installed ion_auth and I am using ci_session database table for my sessions.

I have a controller called MY_controller that overides CI controller and all of my controllers extend this. In MY_controller I set various pieces of session data using session->set_userdata().

I do this as soon as a user enters my site because I need to capture their IP and determine their location, etc. and store this information in the session.

Now, when I try to log into my site via ion_auth, a new session is created in the database versus the ion_auth session user data being added to my existing session. Because of this, ion_auth cannot find the needed session user data to pass the logged_in() check.

I do not want to have to read the database to get the correct session. Any ideas on how to merge the sessions or make sure only one session is created/used?