![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a question regarding keeping a username in the cache in order to prevent multiple logins. I read 'Preventing Multiple Logins in ASP.NET' by Peter Bormberg (great article http://www.eggheadcafe.com/articles/20030418.asp) and everything works fine, however, I think we are going to have problems from our users having to wait for their cache to clear out before they can login again. Is there a way to clear the username out of the cache when they logout? I seem to be missing something here. In my logout: System.Web.Security.FormsAuthentication.SignOut() Dim i As Integer For i = Session.Count - 1 To 0 Step -1 Session.Remove(Session.Keys(i)) Next Session.Remove("user") Session.Abandon() Does not work. When I go back to login, it is still finding the 'user' in the cache item.?.? Can I not remove this item from the cache? What do I not understand here? |
#3
| |||
| |||
|
|
*Ok, it seems as though I got ahead of myself. This code added to my logout procedure allows me log out and back on. Dim _sKey As String _sKey = Session.Item("user") If Not _sKey = "" Then HttpContext.Current.Cache.Remove(_sKey) End If Now, how can I handle the user who refuses to use the logout button? If they just close their browser, I assume there is nothing that can be done except wait for the cache to expire. Will we be able to release this user somehow in IIS for those users who will call and complain? "seal" wrote: I have a question regarding keeping a username in the cache in order to prevent multiple logins. I read 'Preventing Multiple Logins in ASP.NET' by Peter Bormberg (great article http://www.eggheadcafe.com/articles/20030418.asp) and everything works fine, however, I think we are going to have problems from our users having to wait for their cache to clear out before they can login again. Is there a way to clear the username out of the cache when they logout? I seem to be missing something here. In my logout: System.Web.Security.FormsAuthentication.SignOut() Dim i As Integer For i = Session.Count - 1 To 0 Step -1 Session.Remove(Session.Keys(i)) Next Session.Remove("user") Session.Abandon() Does not work. When I go back to login, it is still finding the 'user' in the cache item.?.? Can I not remove this item from the cache? What do I not understand here? * |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |