Last post Jul 21, 2019 05:24 PM by bruce (sqlwork.com)
Jul 20, 2019 05:18 AM|Thai Dang|LINK
I have a request from my customer: 'Prevent multi user with same account id login at the same time'. I have implemented like this: create userflag in account table. When user login, flag is active (1). The other can't login when flag was 1. When user log
out, the flag is deactive(0).
But I have trouble when user doesn't logout. If he directly close browser, the flag still active. Could you give me some advised to fix this problem ?
Besides, in asp.net core, I can't find something like SessionEnd event, because I want whenever sessionend, I'll return flag of user in DB, but I can't find it. Please give me some advised. Thanks
Jul 20, 2019 07:02 AM|DA924|LINK
It's not viable IMO, becuase you will always run the risk of user not logging out and the flag is left at one preventing the user from logging in normally.
If the Web site goes down for some reason in the middle of a user's session, then the flag is set. and the user cannot login normally without the flag being set back to 0, which would have to be done for every user that was logged into the program at the
time the site went down.
Jul 21, 2019 05:24 PM|bruce (sqlwork.com)|LINK