You are here: Re: How to restrict multiple login using a single account. « All PHP « IT news, forums, messages
Re: How to restrict multiple login using a single account.

Posted by Tom on 05/23/07 17:00

On 22 May 2007 02:10:06 -0700, shankhar wrote...
>
>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
>


I think the problem you'll run into is the Web isn't a constant connection so
once the visitor gets the requests web page from your server, there isn't a
connection anymore.

Maybe set it up so that when the user logins in, you look for any prior
sessions, and if there are you can clear the entry from your table and make sure
you kill the actual connection if it still exists.

Tom
--
Newsguy
Basic Accounts $5.95 / month or $39.95 / 12 months
http://newsguy.com/overview.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация