def setUserCookie(self, userid): self.set_secure_cookie("u", userid) new_cookie = str( self._new_cookie.get('u')).split('=')[1].split(';')[0].replace( '"', '') self.set_user_cookie_record(new_cookie, userid) USER_COOKIE_TIME_OUT = 3600 * 24 * 30 RedisDb.setex(new_cookie, userid, USER_COOKIE_TIME_OUT)
def setCookie(cookie, uid): return RedisDb.setex(cookie, uid, 3600 * 24 * 30)
def set_user_cookie_record(self, cookie, userid): USER_COOKIE_TIME_OUT = 3600 * 24 * 30 RedisDb.setex(userid, cookie, USER_COOKIE_TIME_OUT) return RedisDb.setex(cookie, userid, USER_COOKIE_TIME_OUT)