protected void Session_Start() { using (Models.WriststoneContext db = new Models.WriststoneContext()) try { //Session["login"] = Request.Cookies["user"].Value; //var login = Session["login"].ToString(); //Session["id"] = db.Accounts.Where(e => e.Login.Equals(login)).Single().Id; } catch (NullReferenceException) { } }