Beispiel #1
0
    redirect('/')


@app.get('/logout')
def logout():
    session_id = request.get_cookie('session_id')
    if not session_id:
        redirect('/')

    session = Session()
    data = session.get(session_id)
    session.rem(session_id)
    uid = data.get('uid', None)
    if uid:
        # 重置其session_id
        Session.refresh_session_id(uid)

    response.set_cookie('session_id', '')
    redirect('/')


@app.get('/oautherror')
def oautherror():
    print 'OAuth Error!'
    redirect('/')


if __name__ == '__main__':
    run(app, port=8000)
Beispiel #2
0
    
    
    
@app.get('/logout')
def logout():
    session_id = request.get_cookie('session_id')
    if not session_id:
        redirect('/')
    
    session = Session()
    data = session.get(session_id)
    session.rem(session_id)
    uid = data.get('uid', None)
    if uid:
        # 重置其session_id
        Session.refresh_session_id(uid)
        
    response.set_cookie('session_id', '')
    redirect('/')
    
    
    
@app.get('/oautherror')
def oautherror():
    print 'OAuth Error!'
    redirect('/')
    
    
if __name__ == '__main__':
    run(app, port=8000)
Beispiel #3
0
    
    
    
@app.get('/logout')
def logout():
    session_id = request.get_cookie('session_id')
    if not session_id:
        redirect('/')
    
    session = Session()
    data = session.get(session_id)
    session.rem(session_id)
    uid = data.get('uid', None)
    if uid:
        # 重置其session_id
        Session.refresh_session_id(uid)
        
    response.set_cookie('session_id', '')
    redirect('/')
    
    
    
@app.get('/oautherror')
def oautherror():
    print 'OAuth Error!'
    redirect('/')
    
    
if __name__ == '__main__':    
    run(app)