I'm working in chat application, I used HashTable for containing User and Operator as a Key & Object of ChatRoom Class as a value of HashTable. Main problem is that When user or Operator close browser or disconnected without logout then It is automatically logout on the end of the session.
Please help me related to that and how to use Global.asax in this matter.
When does a Session End? A session ends if a user has not requested or refreshed a page in the application for a specified period. By default, this is 20 minutes. If you want to set a timeout interval that is shorter or longer than the default, use the Timeout property.
Clear() will not cause the Session_End eventhandler in your Global. asax file to execute. But on the other hand Session. Abandon() will remove the session altogether and will execute Session_End eventhandler.
You can use global.asax's session end event to remove the unexpectedly disconnected user :
void Session_End(Object sender, EventArgs E) {
// Clean up session resources
}
but beware, session doesn't end when the user closes his browser or his connection lost. It ends when the session timeout reached.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With