2
Как обновить многовалютный файл cookie в ASP.NET?Обновление многовалютного файла cookie в ASP.NET MVC?
Как обновить многовалютный файл cookie в ASP.NET?Обновление многовалютного файла cookie в ASP.NET MVC?
public ActionResult ModifyCookie()
{
// Read the cookie from the request
var cookie = Request.Cookies["cookieName"];
// Verify that the cookie was present
if (cookie != null)
{
// modify a value given the key
cookie.Values["key"] = "modified value";
// write the modified cookie back to the response
Response.AppendCookie(cookie);
}
return View();
}
Response.AppendCookie (...) был, что мне не хватало. Благодарю. –
На самом деле необходимо обновить существующий файл cookie be: 'Response.SetCookie (cookie)' Response.AppendCookie просто добавляет файл cookie в коллекцию. –