Dual Login

rjgagui

Member
Joined
Nov 5, 2014
Messages
18
Programming Experience
Beginner
please need some advice on this guys..

prevent dual login logic :

Login Form.

  1. User's input username and password
  2. check if user is already logged in (see below)
  3. Continue to main form when not in used.
Main form.
  • a timer is enable tick interval 500
  • every tick of the timer updates the loggedTime in the user database

>> Checking if user is already logged in
  • get the last entry in user log of the user
  • assigned loggedTime column to a variable then after an interval of 500 retrieve again the last entry in user log.
  • if the the previous loggedTime is the same as the currently retrive loggedTime then the user account is not in use.
  • else the account is already in use.

Im currently using this logic in one of my system and the problem actually is the performance because for every 500 ticks the system updates the user log and my currently have 16 + users.
is there other way in preventing dual login???
 
What type of application is this? Is it WinForms? If so then you are guaranteed to be able to log the user out because you can do so when the application closes or when another user logs in from the same instance. In that case, why do you need the Timer at all?
 
What type of application is this? Is it WinForms? If so then you are guaranteed to be able to log the user out because you can do so when the application closes or when another user logs in from the same instance. In that case, why do you need the Timer at all?
i dont want to automatically logut the currently loggedin user, when the system detected dual login a an alert dialog is prompting with the login details(ipaddress,pcname,etc.) to be able to manually logout. the reason for the timer is to be able to determine if the user is still logged even after crash. for example i can just set a boolean log=false or true, that can be toggle when user is close the application or logged into the system. but my concern if when the system crashes for some reason there will be no event to handle that, but because of the timer the system can tell whether the supposedly loggedin user is responsive or not, if not then the one attempting to log will be allowed. i hope i explained it.. sorry for the bad english..
 
Back
Top