I've tried adding ("using") System.Net.Http, System.Web.Http, but it still isn't available when I start typing the code.
I tried HttpServer.ResponseCookies & HttpServer.ResponseCookie but they don't seem to work for setting cookies. They both say they don't contain a constructor that contains 1 argument.
Any ideas?
Here's what I've tried:
Code: Select all
HttpServer.ResponseCookie myHelmsCookie = new HttpServer.ResponseCookie("helms-dismissed");
myHelmsCookie.Value = "true";
Code: Select all
HttpCookie HelmsCookie = Request.Cookies.Get("helms-dismissed");
if (HelmsCookie == null) {
// Cookie doesn't exist so create it
HelmsCookie = new HttpCookie("helms-dismissed");
HelmsCookie.Value = "true";
Response.Cookies.Add(HelmsCookie);
}
else {
// change value to true
HelmsCookie.Value = "true";
Response.Cookies.Add(HelmsCookie);
}