Welcome Guest, Not a member yet? Register   Sign In
Question about CI_Session
#6

[eluser]WanWizard[/eluser]
No problem, English isn't my first language either, that's why it's always good to ask for clarification. Smile

In that case I would extend the session library, create an extra field user_id in the session table, and store the user_id of the logged in user in that field. When a user logs in, and the login is valid, run a delete query on the session table where user_id = the user that just logged in. If there were no other sessions for that user, the delete does nothing. If there were, the delete makes their session invalid which effectively logs them out.

It is possible to do this with the standard session library, in which case your delete should have a where clause with a regex because you have to get the user_id from the serialized user_data array, which can be done is is more advanced.


Messages In This Thread
Question about CI_Session - by El Forum - 08-24-2010, 02:47 PM
Question about CI_Session - by El Forum - 08-24-2010, 04:43 PM
Question about CI_Session - by El Forum - 08-25-2010, 08:02 AM
Question about CI_Session - by El Forum - 08-25-2010, 12:28 PM
Question about CI_Session - by El Forum - 08-25-2010, 02:39 PM
Question about CI_Session - by El Forum - 08-26-2010, 12:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB