code: def cookie_signature(seed, *parts):
      
      sha1 = hmac.new(seed, digestmod=hashlib.sha1)
      for part in parts:
          if part:
              sha1.update(part)
      return sha1.hexdigest()
docs: Generates a cookie signature.