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 3391132
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:46:13+00:00 2026-05-18T03:46:13+00:00

In php i create a session with the id of the user. So i

  • 0

In php i create a session with the id of the user. So i do

$_SESSION['id'] = $id;

So say for user 3. Is there a way i could list all sessions for user 3? Also remotely kill the session(logging them out). I want to give users something like gmail where they can view sessions for their account. I also want to allow them to remotely log out sessions out for their user account. Most of my site is done but this is something i am very unsure of. I am not even sure if Php has support for this. I want to do this to beef up security. So say someone went to school or somewhere and forgot to logout they could just remotely do it from another computer with their account. Also i plan to store their IP in the session, also last time. So it can also list IP address, Last time. Have any clues on how to do this? Has anything like this been done with php sessions?

  • 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-18T03:46:13+00:00Added an answer on May 18, 2026 at 3:46 am

    You can set up a session-handler, who writes the session data into a database. Then you can analyze that table to find other session with the same id.

    http://php.net/manual/en/function.session-set-save-handler.php

    Thats the session-way. But I would suggest to implement this on your own, because the session-data is serialized, so you must read all sessions, deserialize it and search for the one key “id”.

    You can create a table with (lets say) session-id, user-id, ip and time. Every time a user logs in you put a record into that table and on every request you should update the time (its something like “last seen”).
    If you want to know if there are other users with one id, simply select over the user-id column. The “legal” user can be identified by the session-id.
    Next, if you want “remote logout” a session you can add a column “force_logout” or something. Now on the next request (of the “illegal” user) you read this flag and kill the session, if its set.

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

Sidebar

Related Questions

Is there any thing in PHP to create basic scaffold, like in Rails? EDIT:
At the moment my CMS creates a PHP session for every user who visits
I found the following code to create a tinyurl.com url: http://tinyurl.com/api-create.php?url=http://myurl.com This will automatically
My attempts to query MySQL from PHP with a create statement of a store
Is it possible to create images with PHP (as opposed to simply linking to
Can you create websites with Chinese characters in PHP? UPDATE: Perhaps I should have
I like Doxygen to create documentation of C or PHP code. I have an
In a PHP project I'm working on we need to create some DAL extensions
I want to create a file on the webserver dynamically in PHP. First I
I'm programming in PHP and would like to create web pages which have email

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.