Hi,
I've used this code to prevent simultaneous logons:
Dim strConCat As String = e.User.Username
Dim strUser As String = Convert.ToString(Cache(strConCat))
If strUser Is Nothing Or strUser.Equals([String].Empty) Then
Dim SessTimeOut As New TimeSpan(0, 0, Session.Timeout, 0, 0)
Cache.Insert(strConCat, strConCat, Nothing, DateTime.MaxValue, SessTimeOut, CacheItemPriority.NotRemovable, Nothing)
' rest of the code for user login
Else
AddModuleMessage("MultipleLoginFailed", ModuleMessageType.RedError, True)
End If
It works fine, but cache object is not destroyed when i logout, or close browser, it's still there until SessTimeOut. Is there some configuration for cache in DNN for this to work, or I'm doing something wrong?
Thanks!