def encode_cookie(payload):
 return u'{0}|{1}'.format(payload, _cookie_digest(payload))

def encode_cookie ( payload ) : return u'{0}|{1}' . format ( payload , _cookie_digest ( payload ) )
this will encode a unicode value into a cookie .