Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6052451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:55:49+00:00 2026-05-23T07:55:49+00:00

I have tracked the online user session with a img tag with the code

  • 0

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;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:55:49+00:00Added an answer on May 23, 2026 at 7:55 am

    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.

    //get current logged in user user - this way we get it as a GET or POST parameter - NOT safe, because the user can modify this parameter - you could get it from the login form for example
    $current_user = md5($_REQUEST["user"]); 
    // start user's sessions like this
    ini_set('session.save_handler', 'files');
    //load the session of the current user 
    $current_user = md5($_REQUEST["user"]);
    //set the current session id to the one corresponding to current user
    session_id($current_user);
    session_save_path("/tmp/sessions/");
    session_start();
    

    In your admin part, get the username as parameter, compute the md5 on it, then delete the session of that user:

    $current_user = md5($_REQUEST["user"]);
    unlink("/tmp/sessions/$current_user");
    

    This code might not work out of the box for you, but it’s a good way to follow

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple user production report where daily quotas are tracked. The sql
REVISED QUESTION : We have tracked this down to a custom add to cart
Have you guys had any experiences (positive or negative) by placing your source code/solution
I have a tracked database (already added) file in git. I want this file
I have tracked down my deadlock to this thread not pumping messages anymore, but
Post Update: I have tracked down the problem at the command ExecuteNonQuery. That's the
So within my project tracked by subversion, I have a folder (let's call it
I have a strange phenomenon while continuously instantiating a com-wrapper and then letting the
I have been reading a number of articles online suggesting different approaches to migrate
I have a ListBox that contains a number of User items that are DataTemplate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.