faqts : Computers : Programming : Languages : JavaScript : Windows

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 8 people (38%) answered Yes
Recently 3 of 8 people (38%) answered Yes

Entry

I have a login where I dont want a particular user to login more than one session. How do I do this?

Apr 25th, 2002 05:46
Jean-Bernard Valentaten, Sudarsan R,


The answer is easy, use cookies.
When the user logs in, you check whether that cookie already exists or 
not. If it does exist, don't let him login, if it doesn't, you create 
it. When the user logs off, you delete the cookie.
But to be honest, I wouldn't use js for login-purposes. It's just not 
secure enough. Any scriptkiddie could find the file containing the 
login/password pairs and thus hack in.
Why don't you use serverside scripts, like PHP, ASP, JSP, PERL or the 
like?!
HTH,
Jean