/**
  * Set the language tag cookie.
  *
  * @param string|null $langTag The language tag, or null to reset.
  *
  * @throws Exception Throws if the language tag is unknown or invalid.
  */
 public static function setCookieLanguageTag($langTag)
 {
     // Make sure the tag is valid or null
     if ($langTag !== null && !static::isWithTag($langTag)) {
         throw new Exception('Invalid or unknown language tag.');
     }
     // Set or reset the cookie
     if ($langTag !== null) {
         CookieManager::setCookie(static::LANGUAGE_COOKIE_NAME, $langTag, static::LANGUAGE_COOKIE_EXPIRE);
     } else {
         CookieManager::deleteCookie(static::LANGUAGE_COOKIE_NAME);
     }
 }