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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:06:07+00:00 2026-05-15T04:06:07+00:00

i have a question. I have a website in which i am giving security

  • 0

i have a question.
I have a website in which i am giving security like login id and password( as usual). No what i want is that,
1) I don’t want to allow a single user to login in different machine at the same time.
2) For this i am using a column in database which is keeping the current status of user(i.e. loging/logout). I am allowing user to login only when has session has not closed and status is login.
3) So my problem is that when i am logging out manually. it is closing the session as well as updating the database with status “logout”.
4) but when i am closing the window from Cross buttonat top right corner. it is closing the ssion but table data is still “login”. so later on i can’t be able to login into the same user.
5) So how could i solve this problem.
Please help me!

  • 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-15T04:06:07+00:00Added an answer on May 15, 2026 at 4:06 am

    1) I don’t want to allow a single user
    to login in different machine at the
    same time.

    Every time a user tries to login, check if a session has already been set. You can do this by saving a hash of a unix time stamp to the database that is associated with the user as well as set the hash to the session every time a user logins. Once the user logins again, you’ll create a new hash which will overwrite the old hash in the database.

    Then in all your protected files, you can compare the session hash variable to the one in the database. If it doesn’t match, log the user out- but the new login instance will still stay active.

    2 + 3 + 4) For this i am using a
    column in database which is keeping
    the current status of user(i.e.
    loging/logout). I am allowing user to
    login only when has session has not
    closed and status is login. So my
    problem is that when i am logging out
    manually. it is closing the session as
    well as updating the database with
    status “logout”.but when i am closing
    the window from Cross buttonat top
    right corner. it is closing the ssion
    but table data is still “login”. so
    later on i can’t be able to login into
    the same user.

    For this, you have to save a last active unix time stamp. You will also have to come up with amount of time before you “logout” the user- this is usually an hour or 3600 seconds. Either using a cron job or an include file on certain pages, you can check the times for the users and compare them doing if(time - last_active_time > 3600){your_logout_func();}

    5) So how could i solve this problem. Please help me!

    Doing that above should fix your problems, but of course there are many ways to solve it 🙂

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

Sidebar

Related Questions

Bit of a strange question. I have a website which has some pages in
I'm building a small website which will have FBA enabled (SqlMembershipProvider) and I want
I have a question of how to develop a small website which is quick
Hey guys I have a question which is... I want a panel at the
I have a requirement that in a SQL Server backed website which is essentially
We have in the company a asp.net website which has a pages that depends
Basically my question is i have a website which was developed around 3 years
I have a classifieds website which I am creating a login system for... In
I have a question about XSLT. On a website i have a simple calendar,
I have a question about tables in MySQL. I'm currently making a website where

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.