public ActionResult SetThemeCookie(string theme, string returnurl)
{
if (!string.IsNullOrEmpty(theme))
{
if (Request.Cookies["app_theme"] != null)
{
Response.Cookies["app_theme"].Value = theme;
Response.Cookies["app_theme"].Expires = DateTime.Now.AddYears(1);
}
else
{
HttpCookie cookie = new HttpCookie("app_theme", theme);
cookie.Expires = DateTime.Now.AddYears(1);
Response.Cookies.Add(cookie);
}
}
return Redirect(returnurl);
}