Dar*_*rov 11
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();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6270 次 |
| 最近记录: |