Skip to content

Commit

Permalink
tl-its-umich-edu#1029 expiriring Django session
Browse files Browse the repository at this point in the history
  • Loading branch information
pushyamig committed Sep 1, 2022
1 parent c5af6df commit 05851ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/env_sample.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
# SameSite settings for Session and CSRF (defaults in settings.py should work), if you do want non-string None set to null.
"SESSION_COOKIE_SAMESITE": "None",
"CSRF_COOKIE_SAMESITE": "None",
# user django session expiriration, defaults to 24hrs matching canvas
"SESSION_COOKIE_AGE": 60,
# django Session to expire on browser close (quite), defaults to true
"SESSION_EXPIRE_AT_BROWSER_CLOSE": true
# Warning:
# This enables debugging of Django code
# Use "true" for local development
Expand Down
6 changes: 6 additions & 0 deletions dashboard/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@
'django.contrib.messages.middleware.MessageMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
]
# user django session expiriration, defaults to 24hrs
SESSION_COOKIE_AGE = ENV.get('SESSION_COOKIE_AGE', 86400)

# django Session to expire on browser close (quite), defaults to true
SESSION_EXPIRE_AT_BROWSER_CLOSE = ENV.get('SESSION_EXPIRE_AT_BROWSER_CLOSE', True)


CRON_CLASSES = [
"dashboard.cron.DashboardCronJob",
Expand Down

0 comments on commit 05851ae

Please sign in to comment.