예제 #1
0
def delete():
    sessionID = request.cookies.get("NemesisCardSession", "")
    if sessionID:
        try:
            del SESSIONS[sessionID]
        except KeyError:
            pass
        response.set_cookie("NemesisCardSession", "")
예제 #2
0
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