Skip to content

Commit

Permalink
Set a much later cookie expiration date #105
Browse files Browse the repository at this point in the history
  • Loading branch information
vicwomg committed Feb 15, 2021
1 parent b61506d commit f5cfed1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
import datetime
import json
import logging
import os
Expand Down Expand Up @@ -75,7 +76,9 @@ def auth():
p = d["admin-password"]
if (p == admin_password):
resp = make_response(redirect('/'))
resp.set_cookie('admin', admin_password)
expire_date = datetime.datetime.now()
expire_date = expire_date + datetime.timedelta(days=90)
resp.set_cookie('admin', admin_password, expires=expire_date)
flash("Admin mode granted!", "is-success")
else:
resp = make_response(redirect(url_for('login')))
Expand Down

0 comments on commit f5cfed1

Please sign in to comment.