List Info

Thread: How to restrict multiple login using a single account.




How to restrict multiple login using a single account.
country flaguser name
United States
2007-05-22 04:07:35
Hi all,

   In my project there is a requirement. If a user logged in
at a time
since he/she logged out others are not allowed to loggin
using the
same user name. That is to avoid multiple logins using a
account. How
to do this?

   I had got a idea and implemented.

   1. When a user logs in storing the username, ip, login
time to db.
   2. When a User logs in i'll check the table whether the
username
exists in the table or not if yes i'll not allow the user to
login
else i'll allow to loggin.
   3. When he logs out i'll delete the record from the
table. Then he/
she can login again.

But there is a problem in this the user can close the
browser directly
or right click in the taskbar and close it or by pressing
Alt + F4. So
for this i have to catch the things in Javascript and
trigger the
logout.

Is is possible to catch the events in Javascript, if yes
please
provide me.

Or Is there any other method to restrict multiple login
using single
account.

Thanx in advance.

Shankhar


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP & MySQL" group.
To post to this group, send email to phpmysqlgooglegroups.com
To unsubscribe from this group, send email to
phpmysql-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/phpmysql?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )