def todo(instance, arg=None): if ('token' not in web.cookies()) \ and ('auth' not in session or session.get('auth') == 0): raise web.seeother('/login') if arg: return func(instance, arg) return func(instance)
def GET(self): print web.ctx cur_user = session.get('register') if cur_user: session.pop('register') return render.login(cur_user=cur_user) else: return render.login(cur_user=None)
def index(): username = request.cookies.get('username') user = session.get('username') print(username, user) return render_template('index.html', **locals())