Locale from cookie, fix JS locale infinite loops