set cookie expiration adte
This commit is contained in:
parent
4b081db610
commit
0b6578d985
6
main
6
main
|
@ -5,6 +5,7 @@ import sqlite3
|
||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
import secrets
|
import secrets
|
||||||
|
import datetime
|
||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
from werkzeug.utils import secure_filename
|
from werkzeug.utils import secure_filename
|
||||||
from werkzeug.security import generate_password_hash, check_password_hash
|
from werkzeug.security import generate_password_hash, check_password_hash
|
||||||
|
@ -274,8 +275,11 @@ def login():
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
expire_date = datetime.datetime.now
|
||||||
|
expire_date = expire_date + datetime.timedelta(days=365)
|
||||||
|
|
||||||
resp = make_response(redirect("/"))
|
resp = make_response(redirect("/"))
|
||||||
resp.set_cookie("session_DO_NOT_SHARE", randomCharacters)
|
resp.set_cookie("session_DO_NOT_SHARE", randomCharacters, expires=expire_date)
|
||||||
|
|
||||||
return resp
|
return resp
|
||||||
else:
|
else:
|
||||||
|
|
Reference in New Issue