aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorubq323 <ubq323>2021-11-06 17:24:47 +0000
committerubq323 <ubq323>2021-11-06 17:24:47 +0000
commita81dee6c19fc6da7c8a82f6e8844ecff72a909e9 (patch)
treecd9167238cfae51df6e19105f8515df6d70cdb4b
parent17357a3fb5cf603ff79daad644f4a4c0fbe42150 (diff)
use permanent session so you don't keep getting signed out
-rw-r--r--apioforum/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/apioforum/__init__.py b/apioforum/__init__.py
index 087df81..037afd7 100644
--- a/apioforum/__init__.py
+++ b/apioforum/__init__.py
@@ -1,7 +1,7 @@
# boilerplate boilerplate boilerplate
# yay
-from flask import Flask, request
+from flask import Flask, request, session
from .db import get_db
import os
@@ -65,6 +65,10 @@ def create_app():
def md_render(s):
return render(s)
+ @app.before_request
+ def permanent_session():
+ session.permanent = True
+
app.add_url_rule("/",endpoint="index")
return app