http://dosya.co/a1oj76da7m70/MemberShip.rar.html  Global.asax         protected void Application_PostAuthenticateRequest(Object sender, EventArgs e)         {              var authCookie = Request.Cookies[FormsAuthentication.FormsCookieName];               if (authCookie != null)             {                 var authTicket = FormsAuthentication.Decrypt(authCookie.Value);                 var serializer = new JavaScriptSerializer();                  var serializeModel = serializer.Deserialize<CustomPrincipalSerializeModel>(authTicket.UserData);                  var newUser = new CustomPrincipal(authTicket.Name);                 newUser.UserId = serializeModel.UserId;                 newUser.Email = serializeModel.Email;                 newUser.Username = serializeModel.Username;                 newUser.Role = serializeModel.Role;                 newUser.Name = serializeModel.Name;                 newUser.LanguageId = serializeModel.LanguageId;                 HttpContext.Current.User = newUser;             }          } ------------------------------ Login Action      var user = UserAuthentication.Login(model.Email, model.Password) ??                        r.GetIQueryableQuery<User>(x => x.Email == model.UserName && x.Password == model.Password && x.Aktif == true).FirstOrDefault();             if (user != null)             {                   var serializeModel = new CustomPrincipalSerializeModel();                 serializeModel.UserId = user.Id;                 serializeModel.Name = user.Name;                 serializeModel.Email = user.Email;                 serializeModel.Role = user.Role;                 var serializer = new JavaScriptSerializer();                  var userData = serializer.Serialize(serializeModel);                  var authTicket = new FormsAuthenticationTicket(                     1,                     user.Email,                     DateTime.Now,                     DateTime.Now.AddYears(15),                     false,                     userData);                  var encTicket = FormsAuthentication.Encrypt(authTicket);                 var faCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encTicket);                 Response.Cookies.Add(faCookie);