How to limit the number of concurrent login per user in php
authentication, php
Solution
You could maintain a DB-table with active user sessions, where a session is considered active, if last user activity took place less then X minutes ago (configurable value).
Each time a user tries to authenticate throgh the login form, you should check how many sessions for that user are active at the moment, and based upon that check make a decision whether to authenticate him or decline with some form of response message.
Problem
I want to prevent the user's concurrent login based on the admin settings. If admin set the concurrent login settings as 3, then the user can login from 3 different places at a time. If the user attempts to login from 4th place, the application should not allow the user to login. Any idea how to maintain this via database. Please help. Thanks in advance.