Beispiel #1
0
 protected void Application_PreRequestHandlerExecute(object sender, EventArgs e)
 {
     if (Context.Handler is IRequiresSessionState || Context.Handler is IReadOnlySessionState)
     {
         SS.SU.BLL.IUserEngineService service = (SS.SU.BLL.IUserEngineService)Spring.Context.Support.ContextRegistry.GetContext().GetObject("UserEngineService");
         service.InitializeUserEngineService();
     }
 }
Beispiel #2
0
 public void DropUsers()
 {
     while (true)
     {
         try
         {
             SS.SU.BLL.IUserEngineService service = (SS.SU.BLL.IUserEngineService)Spring.Context.Support.ContextRegistry.GetContext().GetObject("UserEngineService");
             service.DropUsers(this.Application);
         }
         catch (Exception ex)
         {
             logger.Error(ex.ToString());
         }
         Thread.Sleep(10000);
     }
 }
Beispiel #3
0
        protected void Session_End(object sender, EventArgs e)
        {
            // minus user logout
            try
            {
                #region clear user token cookies
                HttpCookie cookieUserToken = System.Web.HttpContext.Current.Request.Cookies["expUserToken"];
                if (cookieUserToken != null)
                {
                    cookieUserToken.Value = string.Empty;
                    System.Web.HttpContext.Current.Response.Cookies.Add(cookieUserToken);
                }

                HttpCookie cookieUserName = System.Web.HttpContext.Current.Request.Cookies["expUserName"];
                if (cookieUserName != null)
                {
                    cookieUserName.Value = string.Empty;
                    System.Web.HttpContext.Current.Response.Cookies.Add(cookieUserName);
                }

                HttpCookie cookieFromApp = System.Web.HttpContext.Current.Request.Cookies["expFromApp"];
                if (cookieFromApp != null)
                {
                    cookieFromApp.Value = string.Empty;
                    System.Web.HttpContext.Current.Response.Cookies.Add(cookieFromApp);
                }
                #endregion

                SS.SU.BLL.IUserEngineService service = (SS.SU.BLL.IUserEngineService)Spring.Context.Support.ContextRegistry.GetContext().GetObject("UserEngineService");

                service.RemoveUserDict();

                IUserAccount account = (IUserAccount)Spring.Context.Support.ContextRegistry.GetContext().GetObject("UserAccount");
                service.SignOut(account.UserID);
            }
            catch (Exception ex)
            {
                logger.Error("Session_End", ex);
            }
        }