MarseyWorld/files/helpers/session.py

21 lines
319 B
Python
Raw Normal View History

2021-07-21 01:12:26 +00:00
from flask import *
import time
from .security import *
def make_logged_out_formkey(t):
s = f"{t}+{session['session_id']}"
return generate_hash(s)
def validate_logged_out_formkey(t, k):
now = int(time.time())
if now - t > 3600:
return False
s = f"{t}+{session['session_id']}"
return validate_hash(s, k)