I have wrote a code like following:
if (user.PasswordHash == Helpers.PasswordHelper.CreatePasswordHash(model.Password, user.PasswordSalt))
{
ClaimsIdentity identity = new ClaimsIdentity(DefaultAuthenticationTypes.ApplicationCookie);
identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, model.Email));
List<Claim> claims = new List<Claim>();
var roles = user.UserRoles.Where(x => x.UserId == user.UserId).ToList();
foreach (var item in roles)
{
claims.Add(new Claim(ClaimTypes.Role, item.Roles.RoleName));
}
identity.AddClaims(claims);
identity.AddClaim(new Claim(ClaimTypes.Name, model.Email));
AuthenticationManager.SignIn(identity);
return RedirectToAction("Index", "Dashboard");
}
Inside my model I have the remember me property which I want to incorporate upon user login, how can I do that?
P.S. The value is bool and I just need to somehow now tell the browser what the user picked from the login menu...