Пример #1
0
 public static void LoginMember(string _email, bool _rememberAccount)
 {
     LogoutMember();
     if (_rememberAccount)
     {
         CookieUtility.SetCookieNoExpire("Member_Email", _email);
     }
     else
     {
         CookieUtility.SetCookie("Member_Email", _email, 1);
     }
 }
Пример #2
0
        public static void LoginUser(string _email, bool _rememberAccount)
        {
            //LogoutUser();
            //FormsAuthentication.Initialize();
            //FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, ADMIN_PREFIX + _email, DateTime.Now, DateTime.Now.AddMinutes(45), _rememberAccount, "", FormsAuthentication.FormsCookiePath);
            //Trace.Write(FormsAuthentication.FormsCookiePath + FormsAuthentication.FormsCookieName);
            //HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(ticket));
            //HttpContext.Current.Response.SetCookie(cookie);

            LogoutUser();
            if (_rememberAccount)
            {
                CookieUtility.SetCookieNoExpire("User_Email", _email);
            }
            else
            {
                CookieUtility.SetCookie("User_Email", _email, 1);
            }
        }