Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
Add ability to set session age in config file
Browse files Browse the repository at this point in the history
  • Loading branch information
propyless committed Sep 19, 2015
1 parent 02f0683 commit 8b1e452
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions config.yaml.example
Expand Up @@ -72,6 +72,11 @@ NODES_DEFAULT_FACTS:
# DJANGO CONFIGURATION #
########################

# The session age is how long after the latest request the session cookie should expire.
# It is specified in hours - So the below would expire the cookie after two hours.
SESSION_AGE: 2


SECRET_KEY: 'super_secure_random_key'

# SECURITY WARNING: don't run with debug turned on in production!
Expand Down
6 changes: 4 additions & 2 deletions puppet/settings.py
Expand Up @@ -162,8 +162,10 @@

# Expire sessions at browser close
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
# Expire Session after 1 hour
SESSION_COOKIE_AGE = 3600
# Expire Session after x hours
SESSION_AGE = cfg.get('SESSION_AGE', 60)
SESSION_COOKIE_AGE = SESSION_AGE * 3600


# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/
Expand Down

0 comments on commit 8b1e452

Please sign in to comment.