Current location: Hot Scripts Forums » Programming Languages » ASP » One user per username login session (to prevent username sharing)


One user per username login session (to prevent username sharing)

Reply
  #1 (permalink)  
Old 04-26-04, 04:10 PM
jdavis7453 jdavis7453 is offline
New Member
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question One user per username login session (to prevent username sharing)

I'm having problems with multiple users sharing usernames/passwords. Can someone please help with a html code for this. I have seen a site with a good idea to remedy this but have little knowledge on how to write the script. Here's how that site wrote it. After the first login session is started, if another user logs in with the same username/password, the first user is logged out automatically and this occurance is sent the the webmaster. Perfect for what I need. Please help...Thanks!
Reply With Quote
  #2 (permalink)  
Old 05-01-04, 05:59 AM
kasic's Avatar
kasic kasic is offline
Newbie Coder
 
Join Date: Apr 2004
Location: Serbia
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
I don't know that you can do that in HTML, but I know that you can do this in ASP. when user registered with username lets say fadd, and other wants to register him self with same uname you ofcourse want let this happen and tell him (to that second user) that this user name is alredy taken... I hope I didn't miss the subject ...
Reply With Quote
  #3 (permalink)  
Old 05-01-04, 08:54 AM
bugalyzer bugalyzer is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by jdavis7453
I'm having problems with multiple users sharing usernames/passwords. Can someone please help with a html code for this. I have seen a site with a good idea to remedy this but have little knowledge on how to write the script. Here's how that site wrote it. After the first login session is started, if another user logs in with the same username/password, the first user is logged out automatically and this occurance is sent the the webmaster. Perfect for what I need. Please help...Thanks!
This is possible to do but it would have to be done on the server side, I assume it's being done in PHP or ASP or cgi etc... all you have to do is add a field to the user table called - say - 'logged_in' and when your users login - update this field from 'N' (for NO) to 'Y' (for YES) .. then you can check this field for each new login attempt - if someone is already logged_in then don't grant the session. Be careful though - its very easy to lockout all the accounts by accident -- make sure when users logout that this field is set back to 'N' -- and you have to come up with a way to reset this field if some doesn't logout but they leave your site ... a last_logged_in field would work great ... this way when you check if someone is logged_in -- you can check the last time they last_logged_in and if it was more than say an hour or so - then you can grant the session assuming they never logged out. I hope this wasn't too confusing ... bottom line .. if your not a programmer you wont be able to do this ... and it can't be done using just html.

http://buildacom.com
Reply With Quote
  #4 (permalink)  
Old 05-01-04, 10:57 AM
robtaylor robtaylor is offline
New Member
 
Join Date: Apr 2004
Location: Hemlock, NY
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Using a database like bugalyzer mentions is what you need to do but relying on a user to click "logout" is not a good idea because most of them will not.

This is very difficult to do and likely will not be 100% reliant. Here are some links that cover the issue

http://p2p.wrox.com/archive/asp_discuss/2002-02/11.asp
http://forums.devshed.com/showthread.php?p=584580
http://oldlook.experts-exchange.com:..._20735413.html
Reply With Quote
  #5 (permalink)  
Old 05-07-04, 10:53 AM
nepala nepala is offline
Newbie Coder
 
Join Date: May 2004
Location: Kathmandu
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
I am not sure whether you know programming or not.

For a instance i can give you an idea for programming if you need all the help please ask.

You can create one table in the database with the following fields.

Id, username, Password, check

when ever any one login keep the check value is 1 and if the same username and password is entered again then check for the check field value if it is 1 then it show that the user is already login and another user is trying to login . then you can do what ever you want.

I hope this will help.

__________________--
Ananda Raj Pandey
http://www.softwebsnepal.com
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick Question for you php guru's Tokahashi PHP 3 04-09-04 12:00 PM
vbscript for modifying values in attributes in Session tab of a user in AD W2K-serv Kjell Script Requests 0 01-28-04 08:04 AM
Need Epinions-lite system in PHP & MYSQL wali001 Job Offers & Assistance 4 01-12-04 06:02 AM


All times are GMT -5. The time now is 04:19 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.