diff options
-rw-r--r-- | app.py | 6 | ||||
-rw-r--r-- | default_settings.py | 6 |
2 files changed, 11 insertions, 1 deletions
@@ -18,6 +18,12 @@ if 'SPLINE_ACCOUNT_WEB_SETTINGS' in os.environ: app.all_services = account.SERVICES #TODO: take that from our json file or so +@app.before_request +def session_permanent(): + if app.config.get('PERMANENT_SESSION_LIFETIME'): + session.permanent = True + else: + session.permanent = False @app.before_request def ldap_connect(): diff --git a/default_settings.py b/default_settings.py index e9ae578..e185717 100644 --- a/default_settings.py +++ b/default_settings.py @@ -1,3 +1,6 @@ +from datetime import timedelta + + SECRET_KEY = 'remember to change this to something more random and secret' # CHANGE THIS! (e.g. os.urandom(32) ) @@ -8,7 +11,8 @@ MAIL_CONFIRM_SENDER = 'spline accounts <noreply@account.spline.de>' SENDMAIL_COMMAND = '/usr/sbin/sendmail' -SERVER_NAME = 'localhost:5000' +# to make the cookie a session cookie, set this to None +PERMANENT_SESSION_LIFETIME = timedelta(seconds=600) # 10 minutes LDAP_HOST = 'ldap://localhost:5678' LDAP_BASE_DN = [('dc','account'),('dc','spline'),('dc','inf'),('dc','fu-berlin'),('dc','de')] |