protected void Session_Start() { Session["memberid"] = 0; Session["memberrole"] = "0"; Session["memberinfo"] = null; if (Session["userinfo"] == null && Request.Cookies["OK_password"] != null) { int userid = Convert.ToInt32(Request.Cookies["OK_userid"].Value); string password = Request.Cookies["OK_password"].Value; OKDbEntities Db = new OKDbEntities(); var user = Db.user.SingleOrDefault(x => x.Id == userid && x.Password == password); if (user != null) { Session["userinfo"] = user; Session["userid"] = user.Id; Session["role"] = 10; //user.TypeId.ToString(); } Db.Dispose(); } else if (Session["userinfo"] == null) { Session["role"] = 0; Session["userid"] = 0; } }
protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
protected override void Dispose(bool disposing) { Db.Dispose(); base.Dispose(disposing); }