def accredit(user): if user is not None and user.id > 0: auth = {'uid':-1, 'login_time':''} auth['uid'] = user.id auth['login_time'] = time.strftime('%Y-%m-%d %X', time.localtime()) auth = encryptor.arc4_encode(json.dumps(auth)) if auth: web.setcookie(cookie_auth_name, auth, expires=cookie_auth_time, httponly=True, path='/')
def revocation(): auth = {'uid':-1, 'login_time':''} auth = encryptor.arc4_encode(json.dumps(auth)) web.setcookie(cookie_auth_name, auth, expires=-7, httponly=True, path='/')