在ASP.NET MVC 5中,我有以下扩展:
public static ActionResult Alert(this ActionResult result, String text) {
HttpCookie cookie = new HttpCookie("alert") { Path = "/", Value = text };
HttpContext.Current.Response.Cookies.Add(cookie);
return result;
}
基本上我正在添加一个带有文本的cookie。
在ASP.NET Core中,我找不到创建HttpCookie
的方法。这不再可能吗?