Forum Moderators: coopster
i want to make a user management system that has a rule "One user can login with his id only from one palce so that one id cannot be used from different places by different people to use the system"
very similar to hotmail messenger id, like you cannot login with same id from two PCs at the time and also gmail is doing the same now a days.
how can i make it? i had decided to use a boolean value that when a user logs in i will store "1" in database otherwise "0" would be stored in this coloumn, and during singing in step i will check this boolean value if it is "1" then it means id is already in use otherwise not in use...
and when a user will logout i will change "1" to "0" to make it available for logging in again.
BUT, now i have some logical problem and that is that what if some user abnormally shuts down the system without proper logout? then he will have "1" stored in coloumn and he would not be able to login again.... so i am stuck here...
Please guide me how to perform this task efficiently.
thanks in advance
__________________
If the value is still 1 when one tries to login, I would have displayed some message :) The id is being used or improperly shutdown previously, and try to authenticate the person and give him access.
or better, check take the timestamp of the activities of the person who logged in to the system. If the time elapsed is more than some minutes, you can give access to that person, as he might have changed a PC or has forgotten to logout.
:) That was from the top of my head.
Hab
"user_id" or "user_name" and the "sesion_id"
Then when the user attempts to log in validate weather the user id is logged into the session table or not and if they are with a different session id then return the error as the session_id will not be the same.
Hope i have helped
Del
what if someone abnormally shuts down the system and doesnt logout properly? then how will i do it?
does anyone have any idea that how Hotmail Messenger and Gmail is working now a days?
they are following the same pattern, one person can use on id only fron one place at a moment.
thanks