Posted on: 4/30/2011 12:40:58 PM | Views : 372

Hi: In my asp,net application I use the FormsAuthentication. This is the code when a user login:
if(checkNameAndPass(sUserName, sUserPwd)) { //let the user login Session["current_user_name"] = sUserName; FormsAuthentication.RedirectFromLoginPage(UserName.Text, false); }
 
This works well,but now we want to make sure there must not be more than one user online with the same login name,
I mean if user1 login with name "bill",then before his formsauthenticatoin expire other people (for example "user2" can not login with "bill" again.
But if the login name and password provided by "user2" are valid,he can force the former logined user(the "user1") offline,then he can login with "bill",
 
For example:
user1 login with "username=bill" and "password=000",then he is online now.
then user2 try to login with "username=bill" and "password=123 ...

Go to the complete details ...