public bool Login(string userName, string password, bool createPersistentCookie)
        {
            ApplicationServiceHelper.EnsureAuthenticationServiceEnabled(HttpContext.Current, true);

            //


            if (Membership.ValidateUser(userName, password))
            {
                FormsAuthentication.SetAuthCookie(userName, createPersistentCookie);
                return(true);
            }

            return(false);
        }
 public bool IsLoggedIn()
 {
     ApplicationServiceHelper.EnsureAuthenticationServiceEnabled(HttpContext.Current, false);
     return(HttpContext.Current.Request.IsAuthenticated);
 }
 public void Logout()
 {
     ApplicationServiceHelper.EnsureAuthenticationServiceEnabled(HttpContext.Current, false);
     FormsAuthentication.SignOut();
 }