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")
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")
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")
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")
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")
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")
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')
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("/")