Change the attribute in Web config from util/login.aspx to your custom login page. Implement a check box for remember me that stores the cookie for authentication as permanent. It's a bool flag on the formsauthentication class that you should set to true if I remember correctly.
[HttpPost]
public ActionResult Login(Models.User user)
{
if (ModelState.IsValid)
{
if (Membership.ValidateUser(user.UserName, user.Password))
{
FormsAuthentication.SetAuthCookie(user.UserName, user.RememberMe);
return RedirectToAction("Index");
}
else
{
ModelState.AddModelError(string.Empty, "Login failed!");
}
}
return View(user);
}
i am using FormsAuthentication in login post action.
Can you please explain your thought more briefly.
With that I think all you need is change login url in Web.config. Search for /util/login.aspx and replace with url to your login page. Episerver will take care of the rest for redirects...
Hi,
i have a custom login page.I want load the login credentials if the user is clicked on remember me other wise if the user opens the browser for next time it should redirect to login instead of directly redirecting to home page.