code: def parse_cookie(name, seed, kaka):
      
      if not kaka:
          return None
  
      cookie_obj = SimpleCookie(kaka)
      morsel = cookie_obj.get(name)
  
      if morsel:
          parts = morsel.value.split("|")
          if len(parts) != 3:
              return None
              # verify the cookie signature
          sig = cookie_signature(seed, parts[0], parts[1])
          if sig != parts[2]:
              raise SAMLError("Invalid cookie signature")
  
          try:
              return parts[0].strip(), parts[1]
          except KeyError:
              return None
      else:
          return None
docs: Parses and verifies a cookie value
  
      :param seed: A seed used for the HMAC signature
      :param kaka: The cookie
      :return: A tuple consisting of (payload, timestamp)