code: def valid_name(name):
      "Validate a cookie name string"
      if isinstance(name, bytes):
          name = name.decode('ascii')
      if not Definitions.COOKIE_NAME_RE.match(name):
          return False
      # This module doesn't support $identifiers, which are part of an obsolete
      # and highly complex standard which is never used.
      if name[0] == "$":
          return False
      return Truf valid_name(name):
      "Validate a cookie name string"
      if isinstance(name, bytes):
          name = name.decode('ascii')
      if not Definitions.COOKIE_NAME_RE.match(name):
          return False
      # This module doesn't support $identifiers, which are part of an obsolete
      # and highly complex standard which is never used.
      if name[0] == "$":
          return False
      return True
docs: Validate a cookie name string