protected void Session_End(Object sender, EventArgs e) { HROne.Common.Folder.GetOrCreateSessionTempFolder(Session.SessionID).Delete(true); DatabaseConnection dbConn = HROne.Common.WebUtility.GetDatabaseConnection(Session); if (dbConn != null) { WebUtils.ClearTempTable(dbConn, Session.SessionID); } Application.Lock(); Application["ActiveUsers"] = (int)Application["ActiveUsers"] - 1; if ((int)Application["ActiveUsers"] == 0) { HROneConfig config = HROneConfig.GetCurrentHROneConfig(); if (config.ShutDownDomainAfterUsed) { HttpRuntime.UnloadAppDomain(); } } Application.UnLock(); }