@ConditionalOnMissingBean(name = "casLocaleResolver")
        @Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public LocaleResolver localeResolver(final CasConfigurationProperties casProperties) {
            val localeProps = casProperties.getLocale();
            val localeCookie = localeProps.getCookie();

            val resolver = new CookieLocaleResolver() {
                @Nonnull
                @Override
                protected Locale determineDefaultLocale(final HttpServletRequest request) {
                    val locale = request.getLocale();
                    if (StringUtils.isBlank(localeProps.getDefaultValue())
                        || !locale.getLanguage().equals(localeProps.getDefaultValue())) {
                        return locale;
                    }
                    return Locale.forLanguageTag(localeProps.getDefaultValue());
                }
            };
            resolver.setCookieDomain(localeCookie.getDomain());
            resolver.setCookiePath(StringUtils.defaultIfBlank(localeCookie.getPath(), CookieGenerator.DEFAULT_COOKIE_PATH));
            resolver.setCookieHttpOnly(localeCookie.isHttpOnly());
            resolver.setCookieSecure(localeCookie.isSecure());
            resolver.setCookieName(StringUtils.defaultIfBlank(localeCookie.getName(), CookieLocaleResolver.DEFAULT_COOKIE_NAME));
            resolver.setCookieMaxAge(CookieUtils.getCookieMaxAge(localeCookie.getMaxAge()));
            resolver.setLanguageTagCompliant(true);
            resolver.setRejectInvalidCookies(true);
            return resolver;
        }
This is {@link CasWebAppConfiguration}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-webconfig/src/main/java/org/apereo/cas/config/CasWebAppConfiguration.java