Twice Login
-
You can maintain a database for logged in user. While new user logging in check with the DB for the same user are already logged in or not, if yes show him a message that some one has already logged in using same credentials. Thanks !
-
You can maintain a database for logged in user. While new user logging in check with the DB for the same user are already logged in or not, if yes show him a message that some one has already logged in using same credentials. Thanks !
-
You can. But for that each and every time you have to check with the Database or may be Cached data. You can try like that, Suppose below is your logged in table Structure
M_ID M_Name M_Status
101 Abhi 1
102 Raj 1Now, M_Status ,1 Means these user are logged in. If some other user trying to logged in using same M_ID like 101, you just check your temp DB and and set M_Status=0 and insert a new record as below .
M_ID M_Name M_Status
101 Abhi 0
102 Raj 1
101 Jhon 1Now, who is already logged in
("Abhi")
with the same ID (101
) withM_Status=0
is need to be logged off from application. So, after that table should be like this,M_ID M_Name M_Status
102 Raj 1
101 Jhon 1Its means, if any point of time any M_Status=0, corresponding user need to be logged off from application. This is just an idea. You can think on that :)
-
You can. But for that each and every time you have to check with the Database or may be Cached data. You can try like that, Suppose below is your logged in table Structure
M_ID M_Name M_Status
101 Abhi 1
102 Raj 1Now, M_Status ,1 Means these user are logged in. If some other user trying to logged in using same M_ID like 101, you just check your temp DB and and set M_Status=0 and insert a new record as below .
M_ID M_Name M_Status
101 Abhi 0
102 Raj 1
101 Jhon 1Now, who is already logged in
("Abhi")
with the same ID (101
) withM_Status=0
is need to be logged off from application. So, after that table should be like this,M_ID M_Name M_Status
102 Raj 1
101 Jhon 1Its means, if any point of time any M_Status=0, corresponding user need to be logged off from application. This is just an idea. You can think on that :)
-
If possible please provide some details of implementation, so that it can help some others :)
-
If possible please provide some details of implementation, so that it can help some others :)
MasterPageLoad
Dim userId As String = Session("UserID")
Dim multipleLogin As New Dictionary(Of String, String)()
multipleLogin = New Dictionary(Of String, String)()
Application.Lock()
multipleLogin = DirectCast(Application("MultipleLogin"), Dictionary(Of String, String))
If (multipleLogin.ContainsKey(userId)) Then
Response.Output.Write("<script>alert(You have already signed in. Loggin out)</script>")
Session.Clear()
Response.Redirect("~/Login.aspx")
End IfmultipleLogin.Add(userId, Session.SessionID) Application("MultipleLogin") = multipleLogin Application.UnLock()