code: def decode_cookie(cookie, key=None):
      '''
      This decodes a cookie given by `encode_cookie`. If verification of the
      cookie fails, ``None`` will be implicitly returned.
  
      :param cookie: An encoded cookie.
      :type cookie: str
  
      :param key: The key to use when creating the cookie digest. If not
                  specified, the SECRET_KEY value from app config will be used.
      :type key: str
      '''
      try:
          payload, digest = cookie.rsplit(u'|', 1)
          if hasattr(digest, 'decode'):
              digest = digest.decode('ascii')  # pragma: no cover
      except ValueError:
          return
  
      if safe_str_cmp(_cookie_digest(payload, key=key), digest):
          return payloaf decode_cookie(cookie, key=None):
      '''
      This decodes a cookie given by `encode_cookie`. If verification of the
      cookie fails, ``None`` will be implicitly returned.
  
      :param cookie: An encoded cookie.
      :type cookie: str
  
      :param key: The key to use when creating the cookie digest. If not
                  specified, the SECRET_KEY value from app config will be used.
      :type key: str
      '''
      try:
          payload, digest = cookie.rsplit(u'|', 1)
          if hasattr(digest, 'decode'):
              digest = digest.decode('ascii')  # pragma: no cover
      except ValueError:
          return
  
      if safe_str_cmp(_cookie_digest(payload, key=key), digest):
          return payload
docs: This decodes a cookie given by `encode_cookie`. If verification of the
      cookie fails, ``None`` will be implicitly returned.
  
      :param cookie: An encoded cookie.
      :type cookie: str
  
      :param key: The key to use when creating the cookie digest. If not
                  specified, the SECRET_KEY value from app config will be used.
      :type key: str