Normally HttpCookie is part of the Namespace System.Web
Did I miss an assembly reference? And how can i add this?
The type or namespace name 'HttpCookie' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
This is a potential fix... not
public ActionResult SetCulture(string culture)
{
// Validate input
culture = CultureHelper.GetImplementedCulture(culture);
// Save culture in a cookie
System.Web.HttpCookie cookie = Request.Cookies["_culture"];
if (cookie != null)
cookie.Value = culture; // update cookie value
else
{
cookie = new HttpCookie("_culture");
cookie.Value = culture;
cookie.Expires = DateTime.Now.AddYears(1);
}
Response.Cookies.Add(cookie);
return RedirectToAction("Index");
}