BgEngine.Controllers.ThemeController.SetThemeCookie C# (CSharp) Метод

SetThemeCookie() публичный Метод

Set the cookie storing theme selected by the user
public SetThemeCookie ( string theme, string returnurl ) : System.Web.Mvc.ActionResult
theme string The name of the Theme stored in Themes folder
returnurl string
Результат System.Web.Mvc.ActionResult
        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);
        }