'Sign the content returning a valid cookie (that does not
need to be escaped and quoted).  The expiration of this
cookie is handled server-side in the auth() function.'

def sign(self, content):

    timestamp = make_time((time.time() + (60 * self.timeout)))
    if six.PY3:
        content = content.encode('utf8')
        timestamp = timestamp.encode('utf8')
    cookie = base64.encodestring(((hmac.new(self.secret, content, sha1).digest() + timestamp) + content))
    cookie = cookie.replace('/', '_').replace('=', '~')
    cookie = cookie.replace('\n', '').replace('\r', '')
    if (len(cookie) > self.maxlen):
        raise CookieTooLarge(content, cookie)
    return cookie
