(Http://community.csdn.net/Expert/FAQ/FAQ_Index.asp? Id = 815)
For example, user a has logged on to the Forum. When user B uses user a's account and password to log on to the same forum on another host, user a will return to the login page, and inform the user that this account is in use. Please log in again.
How to implement this function in ASP, please enlighten me!
---------------------------------------------------------------
<%
... Get username .....
If application (username) <> "then
Response. Write "this user has logged on"
Response. End
End if
Application (username) = PASSWORD 'the password for storing the user
%>
---------------------------------------------------------------
1. Use cookies or sessions
When a user logs in, determines whether the value of Session ("login") or cookies (LOGIN ") is null,
If this parameter is set to null, logon is successful, but not empty.
2. One more field AA in the table
When a user logs in, judge whether the AA value is 0,
0 indicates that the logon is successful, but not 0, and 1 indicates that someone has logged in.
Change the value to 0 when the user exits.
---------------------------------------------------------------
Yes, just like on the building. You can set a field in the user information data table to 1 when logging on to the user. The default value is 0 (not online ), set the value directly when the user logs in to verify the user name and password. Use session to determine whether the instance is online. If it is not online, set the value to 0. Can this be done?
In order to judge the IP address on different hosts, a field is added to record the IP address.
---------------------------------------------------------------
There is an online table record online staff, login application ("isuserlogin") = true
<%
If application ("isuserlogin") = true then
Response. Write "this user has logged on"
Response. End
End if
%>
Add the session onend event to the global file. Application ("isuserlogin") = false
In addition, we also need to check whether the wire is suspended. There is a special method, that is, a certain item in the server object.
---------------------------------------------------------------
Cookie cannot guarantee