Yes, I enabled remember me.
[HttpPost]
public async Task<IActionResult> HandleLoginAsync(LoginModel login)
{
if (ModelState.IsValid == false)
{
return CurrentUmbracoPage();
}
var validate = await _memberManager.ValidateCredentialsAsync(login.Username, login.Password);
if (validate)
{
var result = await _memberSignInManager.PasswordSignInAsync(login.Username, login.Password, login.RememberMe, true);
if (result.Succeeded)
{
if (Url.IsLocalUrl(login.RedirectUrl))
{
return Redirect(login.RedirectUrl);
}
return RedirectToCurrentUmbracoPage();
}
}
else
{
ModelState.AddModelError(string.Empty,_dictionaryService.GetOrCreateDictionaryValue("Forums.Error.InvalidCredentials","The username or password provided is incorrect.") );
}
// If there is a specified path to redirect to then use it.
return CurrentUmbracoPage();
}
This creates a 30 day cookie