def delete(): sessionID = request.cookies.get("NemesisCardSession", "") if sessionID: try: del SESSIONS[sessionID] except KeyError: pass response.set_cookie("NemesisCardSession", "")
def start(): sessionID = request.cookies.get("NemesisCardSession", "") if not sessionID: sessionID = hex(random.getrandbits(64))[2:] response.set_cookie("NemesisCardSession", sessionID) if sessionID not in SESSIONS: SESSIONS[sessionID] = CardGameSession() return sessionID