예제 #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
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
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("/")