Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

134
Views
prevent all other user log in with the same user account, I tried the following

first tried i create a login status field in table and by default it will be 0 and when user log in it will update to 1. so when other tried to login with the same account can not logged in. but the problem is when i update the login status when user click to the logout button but when internet connect goes out or pc is shutdown or user close the browser without clicking the logout button then the login status could not be updated and always shows 'some one already logged in'.

second tried I generate a login token at the time of login and store it the database and session also. On every event I check that database token with the session if true then let them process. and when other user login with the same account then the token is update and the previous user log out due to session did not match with the database

but i want that other user can not be logged in while one user is already logged in. because I am creating the online exam portal so in this the first one is not work when user's browser is closed directly or system shutdown and the second one allow the other user to log in and logout the previous user

is there any way to prevent other user can not be logged in while one is log in

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It looks like You need to keep track of active connected users live. I would use web sockets.

Example stack would be: Node.js backend + socket.io library. If You have and existing php application - maybe add a microservice for that. Using javascript You can also track of device ID and specific device disconnect/reconnect due to the network problems.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!