I have the following code for a log
Response.Cookies["correoRepresentante"].Value = CorreoL;
Response.Cookies["correoRepresentante"].Expires = DateTime.Now.AddYears(1);
Response.Cookies["passRepresentante"].Value = contrasena;
Response.Cookies["passRepresentante"].Expires = DateTime.Now.AddYears(1);
and for the logout:
var c = new HttpCookie("correoRepresentante");
c.Expires = DateTime.Now.AddDays(-1);
Response.Cookies.Add(c);
var p = new HttpCookie("passRepresentante");
p.Expires = DateTime.Now.AddDays(-1);
Response.Cookies.Add(p);
Response.Cookies.Clear();
Session.Clear();
return View("log");
but then I put anything back in the log and enter the session I had.