-2

i am working on php language, i want to ensure that one id(username / account) is not login in more than one computer. how can it tobe possible?

the logic is like this, if one account login, he/she cannot login in other computer if he/she did not Logout first from his/her first computer.

if we make some "logic" in LOGOUT button, maybe i can handle it, but how if the computer shutted down? the session is deleted, without executing the "logic" in LOGOUT button.

if412010
  • 337
  • 1
  • 3
  • 9

1 Answers1

1

Just add some additional field to user DB. On login generate unical id into this field (server-sided), send it to user as cookie, for example. And when user performs some action-attempt, compare his cookie with value from DB.

Markus_13
  • 328
  • 2
  • 14