If the user has a token we don't recognize, give them a new one.

This commit is contained in:
voussoir 2018-01-15 20:04:47 -08:00
parent 55e1281774
commit 7352d1e141

View file

@ -51,7 +51,7 @@ class SessionManager:
def wrapped(*args, **kwargs): def wrapped(*args, **kwargs):
# Inject new token so the function doesn't know the difference # Inject new token so the function doesn't know the difference
token = request.cookies.get('etiquette_session', None) token = request.cookies.get('etiquette_session', None)
if not token: if not token or token not in self.sessions:
token = _generate_token() token = _generate_token()
request.cookies = dict(request.cookies) request.cookies = dict(request.cookies)
request.cookies['etiquette_session'] = token request.cookies['etiquette_session'] = token