def has_stored_sec_key(username, frontend_sec): """ Check in redis if the user has a security key for a continuing session else wack their cookies """ sec_key = REDIS.get(username) if sec_key and sec_key == frontend_sec: save_security_to_session(sec_key, username) return True return False