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

290
Views
prevent multiple login Codeigniter 4

i want to make login system, and check if user is multiple login and give notification " account already login in other device" in current user login. how to make system like that? I've searched for it on google but couldn't find the right one

check if user is multiple login and give notification " account already login in other device" in current user login

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

0

Problem:

You can't really tell when the user is still logged in because the stateless server. Lets say I log in inside an incognito window. When I close the session cookie is deleted. But on the server it's still exists. How do you tell I'm actually logged in or not?

Solution:

You can make a heartbeat request to the server and log the activity. So you have a JS code sending request in every minute so you know the user is online. Also in every request you set the cookie as well.

So you log the last activity time in every minute and every request. When the user tries to log in you check if the logged activity is older than two minutes.

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!