public string Loginlocal(UM userInfo) { string re = ""; OhyMongoClient omc = new OhyMongoClient(); UM users = omc.FindOne <UM>(a => a.UserName == userInfo.UserName && a.PassWord == userInfo.PassWord); if (users != null) { //Session["User"] = userInfo.UserName; HttpCookie user = new HttpCookie("User"); user.Value = users._id.ToString(); System.Web.HttpContext.Current.Response.SetCookie(user); re = "1"; } return(re); }