I have tracked the online user session with a img tag with the code below.
<img src="http://www.somedomain.com/track/login.php" alt="" title="" width="1" height="1" />
Using the above code, I have made an administration section to display the online users.
Now, due to some reason. I have to end the session of the online user from the administration section.
Could anyone help me one this.
Note:
in users pages, User session is handled with
if(authenticated) {
$_SESSION['username']=name;
$_SESSION['id']=id;
}
I’d implement this in the following way: use files to store sessions, store those files in some specific location where you have read/write access, give them a predictible name (for example an md5 on username) – and when you want to end a session for a user, simply delete the file that belongs to that user.
In your admin part, get the username as parameter, compute the md5 on it, then delete the session of that user:
This code might not work out of the box for you, but it’s a good way to follow