-2

How do i stop multiple user login with same email and password once the user already logged into the website.

For example:

if a  user already login from chrome and user trying to login from firefox
then system should automatically destroy first session which is created 
from chrome.
Pathik Vejani
  • 4,263
  • 8
  • 57
  • 98
Soumya
  • 7
  • 1
  • 6

2 Answers2

0

The solution is to store your sessions in a database. Then when a user re-attempts to login you can easily delete them from the database. You would probably require a table that stores a session-userID link but that is kinda the solution I use.

Antony
  • 3,875
  • 30
  • 32
0

You can add a field like "is_loggedin" in your user table And update this field value to 1 when any user login. And update it to 0 when any user logout.

At the time of login you can check this field value if it is 1 than user is logged in at other place and you should return your warning message.