コード例 #1
0
def process_logout():

    connection = pymongo.Connection(connection_string, safe=True)

    cookie = bottle.request.get_cookie("session")

    if (cookie == None):
        print "no cookie..."
        bottle.redirect("/signup")

    else:
        session_id = user.check_secure_val(cookie)

        if (session_id == None):
            print "no secure session_id"
            bottle.redirect("/signup")

        else:
            # remove the session

            user.end_session(connection, session_id)

            print "clearing the cookie"

            bottle.response.set_cookie("session", "")

            bottle.redirect("/signup")
コード例 #2
0
ファイル: blog.py プロジェクト: drozas/mongodb
def process_logout():

    connection = pymongo.Connection(connection_string, safe=True)

    cookie = bottle.request.get_cookie("session")

    if (cookie == None):
        print "no cookie..."
        bottle.redirect("/signup")

    else:
        session_id = user.check_secure_val(cookie)

        if (session_id == None):
            print "no secure session_id"
            bottle.redirect("/signup")
            
        else:
            # remove the session

            user.end_session(connection, session_id)

            print "clearing the cookie"

            bottle.response.set_cookie("session","")


            bottle.redirect("/signup")
コード例 #3
0
ファイル: blog.py プロジェクト: erlichson/cs253
def process_logout():
    cookie = bottle.request.get_cookie("session")

    if (cookie == None):
        print "no cookie..."
        bottle.redirect("/blog/signup")

    else:
        session_id = user.check_secure_val(cookie)

        if (session_id == None):
            print "no secure session_id"
            bottle.redirect("/blog/signup")
            
        else:
            # remove the session

            user.end_session(session_id)

            print "clearing the cookie"

            bottle.response.set_cookie("session",";Path=\/")


            bottle.redirect("/blog/signup")
コード例 #4
0
ファイル: blog.py プロジェクト: joaolg83/up-bigdata-2017
def process_logout():

    connection = MongoClient('localhost', 27017)

    cookie = bottle.request.get_cookie("session")

    if (cookie == None):
        print "no cookie..."
        bottle.redirect("/signup")

    else:
        session_id = user.check_secure_val(cookie)

        if (session_id == None):
            print "no secure session_id"
            bottle.redirect("/signup")

        else:
            # remove the session

            user.end_session(connection, session_id)

            print "clearing the cookie"

            bottle.response.set_cookie("session", "")

            bottle.redirect("/signup")
コード例 #5
0
def process_logout():
    connection = MongoClient("localhost", 27017)
    cookie = bottle.request.get_cookie("session")
    if (cookie is None):
        print ("no cookie...")
    else:
        session_id = user.check_secure_val(cookie)
        if (session_id == None):
            print ("no secure session_id")
        else:
            # remove the session
            user.end_session(connection, session_id)
            print ("clearing the cookie")
            bottle.response.set_cookie("session", "")
    bottle.redirect("/signup")     
コード例 #6
0
def logout():
    connection = pymongo.Connection(connection_string, safe=True)
    cookie = request.get_cookie("session")

    if cookie is None:
        print "no cookie..."
        redirect("/login")
    else:
        session_id = user.check_secure_val(cookie)

        if session_id is None:
            print "no secure session_id"
            redirect("/login")
        else:
            # remove the session
            user.end_session(connection, session_id)
            print "clearing the cookie"
            response.set_cookie("session", "")
            redirect("/login")
コード例 #7
0
ファイル: routes.py プロジェクト: chromebookbob/python2012
def logout():
    connection = pymongo.Connection(connection_string, safe=True)
    cookie = request.get_cookie("session")

    if cookie is None:
        print "no cookie..."
        redirect("/login")
    else:
        session_id = user.check_secure_val(cookie)

        if session_id is None:
            print "no secure session_id"
            redirect("/login")
        else:
            # remove the session
            user.end_session(connection, session_id)
            print "clearing the cookie"
            response.set_cookie("session", "")
            redirect("/login")
コード例 #8
0
def logout():
    cookie = bottle.request.get_cookie('session')

    if cookie:
        session_id = user.check_secure_val(cookie)

        if session_id:
            print "Clearing session..."
            user.end_session(session_id)
            print "Session cleared"

            bottle.redirect('/signin')
        else:
            print "Session is not valid"

        bottle.request.set_cookie('session', '')
    else:
        print "No session cookie"

    bottle.redirect('/signin')
コード例 #9
0
ファイル: site.py プロジェクト: alexefremo/diploma
def process_logout():

    connection = pymongo.MongoClient(connection_string)
    cookie = bottle.request.get_cookie("session")

    if (cookie == None):
        print "no cookie..."
        bottle.redirect("/")
        
    else:
        session_id = user.check_secure_val(cookie)

        if (session_id == None):
            print "no secure session_id"
            bottle.redirect("/")
            
        else:
            # удаляем сессию
            user.end_session(connection, session_id)
            print "clearing the cookie"
            bottle.response.set_cookie("session","")
            bottle.redirect("/")