Вопрос

The question is quite straightforward:

How to replace a HttpCookie in MVC3? (Assuming we have access to the HttpContext instance)

Это было полезно?

Решение

Use SetCookie

var cookie = Request.Cookies["cookieName"];
if (cookie != null)
{
    cookie.Value = "new value";
    Response.SetCookie(cookie);
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top