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?
> 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
[quoted text clipped - 20 lines]
> item.?.? Can I not remove this item from the cache? What do I not understand
> here?
darrenterrell - 02 Dec 2005 23:39 GMT
The only solution that I can think of to solve this problem is to create
a function that will call the server via AJAX to sign out the user. You
can call this function in the unload event for the web page. If you use
master pages or some similar implementation, then this will not be too
difficult to do (since you will need this on every page in the web site
- besides the login page). I have used a similar implementation for
this in the past and it worked well. However, I would still recommend
keeping the server side timeout in place. Things like sudden power
outages will kill the session w/o firing the unload event. Let me know
if you need help w/ any of the code.
> *Ok, it seems as though I got ahead of myself.
>
[quoted text clipped - 46 lines]
> understand
> > here? *