But you may have allot of problems with that apporach as when they log out you will need to reset the field back to "0" but if there is a problem or the user disconnects abruptly, like from just closing the program or logging out of windows/reboots, you will not be able to set the logged in state as "0".