protected void Session_Start()
 {
     Session["memberInfo"] = null;
     Session["memberID"]   = 0;
     Session["memberRole"] = 0;
     Session["Index"]      = "0";
     if (Request.Cookies["BGK_memberID"] != null && Request.Cookies["BGK_password"] != null)
     {
         int         memberID = Convert.ToInt32(Request.Cookies["BGK_memberID"].Value);
         string      password = Request.Cookies["BGK_password"].Value;
         BGKEntities Db       = new BGKEntities();
         var         member   = Db.bgk_uye.SingleOrDefault(x => x.Id == memberID && x.Sifre == password && x.Onay == true);
         if (member != null)
         {
             Session["memberInfo"] = member;
             Session["memberID"]   = member.Id;
             Session["memberRole"] = member.Yetki;
         }
         Db.Dispose();
     }
 }
 protected override void Dispose(bool disposing)
 {
     Db.Dispose();
     base.Dispose(disposing);
 }