Welcome Guest, Not a member yet? Register   Sign In
In Code Igniter, destroying a specific session
#1

(This post was last modified: 01-19-2023, 06:11 AM by leusiam.)

I'd want to be able to log people out of my Code Igniter app.

I know how to bring an active local session to a close:

Code:
$this->session->sess_destroy();

How can I end a session that was initiated on another machine and log a user out of their session?
I keep a unique id connected with their account in the session data so that I can see it in the database's session table, but it is stored among the other session data in a column named user data, the contents of which look similar to this:

a:4:
{s:9:"user_data";s:0:"";s:6:"userid";s:6:"189034";s:9:"logged_in";b:1;s:5:"token";i:1767727789;}

wherein 189034 is the user id.

Is there a method to choose a record in the session database depending on the user's id, delete the row, and then kill the session? Is there any way to accomplish this entirely?
Reply


Messages In This Thread
In Code Igniter, destroying a specific session - by leusiam - 01-19-2023, 06:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB