public ActionResult Test_Login()
 {
     //get data from client
     KhachHangController ctr = new KhachHangController();
     String username = TextLibrary.ToString(Request["khachhang_username"]);
     String password = TextLibrary.ToString(Request["khachhang_password"]);
     Boolean remember = TextLibrary.ToBoolean(Request["khachhang_remember"]);
     //validate
     if (ctr.login(username, password))
     {
         Debug.WriteLine("Đăng nhập thành công");
         KhachHang obj = ctr.get_by_username(username);
         if (remember)
         {
             //set Cookies
             HttpCookie _tmp = new HttpCookie("khachhang");
             _tmp["khachhang_id"] = obj.id.ToString();
             _tmp["khachhang_password"] = obj.matkhau;
             _tmp.Expires = DateTime.Now.AddDays(1);
             Response.Cookies.Add(_tmp);
         }
         else
         {
             //set session
             Session["khachhang"] = obj;
         }
         //nếu được dẫn link từ FrontCart.CheckOut thì quay lại checkOut
         if (Session["link_after_login"] != null)
         {
             string url_to = (string)Session["link_after_login"];
             Session["link_after_login"] = null;
             return Redirect(url_to);
         }
         //redirect
         return RedirectToAction("Index", "FrontHome");
     }
     Debug.WriteLine("Đăng nhập thất bại");
     //load view
     return RedirectToAction("Index","FrontLogin");
 }