Reputation: 63
In my application Admin can view the client list if he wish he can logout the user from the application. Can any one help me how to do such type of functionality?
Upvotes: 0
Views: 1584
Reputation: 2189
You will need to setup a token logging session. When a user logs in they receive a SESSION token. That token is stored in a database and on each page load you check whether that token is still valid. If not then redirect the user to the login page. This will also show an admin user valid tokens (i.e. potentially active/logged in users) and also gives the option to remove/log them out by deactivating their token.
Unfortunately this is massive code so I can't "do it for you" but a database with tokens will be your starting point and I've created full functionality using this method.
Upvotes: 2