private function __setCookieAndLocale($locale)
    {
        // @FIXME Should be refactored when cake 3.4 was released
        if (PHP_SAPI !== 'cli') {
            $time = $this->__getCookieExpireTime();
            I18n::locale($locale);
            setcookie($this->__getCookieName(), $locale, $time, '/', $this->config('Cookie.domain'));
        }
    }