aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2020-03-09 16:35:11 -0500
committerzsloan2020-03-09 16:35:11 -0500
commit0d78150d2e61628bec3646efff0a2c5bade7a308 (patch)
tree5aef3a4ca4fbf79c9fc405e20f8bb9fae6c6855c
parentd93b7d79eba47954141ca1be7b4bb657cf1f613a (diff)
downloadgenenetwork2-0d78150d2e61628bec3646efff0a2c5bade7a308.tar.gz
It seems that the cause might be that my user session was still active on production, which made the logic not work
-rw-r--r--wqflask/wqflask/user_session.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/wqflask/wqflask/user_session.py b/wqflask/wqflask/user_session.py
index 8d4b915a..53a43c40 100644
--- a/wqflask/wqflask/user_session.py
+++ b/wqflask/wqflask/user_session.py
@@ -41,8 +41,8 @@ def create_signed_cookie():
class UserSession(object):
"""Logged in user handling"""
- user_cookie_name = 'session_id_v1'
- anon_cookie_name = 'anon_user_v2'
+ user_cookie_name = 'session_id_v2'
+ anon_cookie_name = 'anon_user_v1'
def __init__(self):
user_cookie = request.cookies.get(self.user_cookie_name)
@@ -68,7 +68,6 @@ class UserSession(object):
#ZS: Need to test this by setting the time-out to be really short or something
if not self.record or self.record == []:
if user_cookie:
- logger.debug("NOT RECORD YES USER COOKIE")
self.logged_in = False
########### Grrr...this won't work because of the way flask handles cookies
@@ -79,7 +78,6 @@ class UserSession(object):
#return response
#return
else:
- logger.debug("NOT RECORD NO USER COOKIE")
self.record = dict(login_time = time.time(),
user_type = "anon",
user_id = str(uuid.uuid4()))
@@ -87,7 +85,6 @@ class UserSession(object):
Redis.hmset(self.redis_key, self.record)
Redis.expire(self.redis_key, THIRTY_DAYS)
else:
- logger.debug("YES SELF.RECORD")
if user_cookie:
self.logged_in = True
@@ -131,8 +128,6 @@ class UserSession(object):
else: #ZS: Anonymous user
return None
- logger.debug("REDIS USER ID:", user_id)
-
return user_id
@property