Cats.Web.Hub.MvcApplication.Application_AuthenticateRequest C# (CSharp) Method

Application_AuthenticateRequest() protected method

protected Application_AuthenticateRequest ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {
            HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName];

            if (authCookie != null)
            {

                FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(authCookie.Value);
                var identity = new UserIdentity(UserAccountHelper.GetUser(ticket.Name));
                var principal = new UserPrincipal(identity);
                HttpContext.Current.User = principal;
            }
        }