public static void ReadCookie(HttpCookieCollection cookies) { var timeZoneCookie = cookies["userTimeZone"]; if (timeZoneCookie == null || string.IsNullOrEmpty(timeZoneCookie.Value)) { return; } UserTimeZone.SetTimeZone(timeZoneCookie.Value); }
public override void OnActionExecuting(ActionExecutingContext filterContext) { var timeZoneCookie = filterContext.HttpContext .Request.Cookies["userTimeZone"]; if (timeZoneCookie == null || string.IsNullOrEmpty(timeZoneCookie.Value)) { return; } UserTimeZone.SetTimeZone(timeZoneCookie.Value); }