Firstly, I get the feeling that Response.Redirect just stays from the classic ASP, and I have to use something else in the MVC paradigm.
And secondly, although my current implementation of Response.Redirect IS is working, it does not set the cookie I want. I assume this is because the header is being deleted, not sent to the client when redirecting.
Here is what I still have:
[HttpPost]
public ActionResult Login(FormCollection form)
{
User user;
string sessionKey;
if (UserManager.Login(form["Email"], form["Password"]))
{
Response.Cookies["Email"].Value = form["Email"];
Response.Cookies["Email"].Expires = DateTime.Now.AddDays(31);
Response.Redirect("~/");
}
}
source
share