示例#1
0
        public static void ReadCookie(HttpCookieCollection cookies)
        {
            var timeZoneCookie = cookies["userTimeZone"];

            if (timeZoneCookie == null ||
                string.IsNullOrEmpty(timeZoneCookie.Value))
            {
                return;
            }

            UserTimeZone.SetTimeZone(timeZoneCookie.Value);
        }
示例#2
0
        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);
        }