示例#1
0
        public static void LogoutUser()
        {
            //HttpContext.Current.Items.Remove("ADMIN_INFO");
            //HttpContext.Current.Session.Abandon();
            //FormsAuthentication.SignOut();

            if (CookieUtility.GetCookie("User_Email") != null)
            {
                CookieUtility.SetCookie("User_Email", CookieUtility.GetCookie("User_Email"), -360);
            }
        }
示例#2
0
 public static void LoginMember(string _email, bool _rememberAccount)
 {
     LogoutMember();
     if (_rememberAccount)
     {
         CookieUtility.SetCookieNoExpire("Member_Email", _email);
     }
     else
     {
         CookieUtility.SetCookie("Member_Email", _email, 1);
     }
 }
示例#3
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);
            }
        }