From 7352d1e141da65de14e3eec58964075e4d509c15 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 15 Jan 2018 20:04:47 -0800 Subject: [PATCH] If the user has a token we don't recognize, give them a new one. --- frontends/etiquette_flask/etiquette_flask/sessions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontends/etiquette_flask/etiquette_flask/sessions.py b/frontends/etiquette_flask/etiquette_flask/sessions.py index 26dafb7..9c35539 100644 --- a/frontends/etiquette_flask/etiquette_flask/sessions.py +++ b/frontends/etiquette_flask/etiquette_flask/sessions.py @@ -51,7 +51,7 @@ class SessionManager: def wrapped(*args, **kwargs): # Inject new token so the function doesn't know the difference token = request.cookies.get('etiquette_session', None) - if not token: + if not token or token not in self.sessions: token = _generate_token() request.cookies = dict(request.cookies) request.cookies['etiquette_session'] = token