summaryrefslogtreecommitdiffstats
path: root/core/utils.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-06-14 20:36:31 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2025-06-14 20:36:31 +0300
commit40fb066e2be579f07e8219bfa2306d66278b4b00 (patch)
tree992f58f2ac0d1fe8cf2c5888d1a957f2272bc2ee /core/utils.py
parentd8cdf7bc5ac1d258b36a8548c354e82ca314197a (diff)
downloadtroggle-40fb066e2be579f07e8219bfa2306d66278b4b00.tar.gz
troggle-40fb066e2be579f07e8219bfa2306d66278b4b00.tar.bz2
troggle-40fb066e2be579f07e8219bfa2306d66278b4b00.zip
refactoring cookie age as a function not a constant
Diffstat (limited to 'core/utils.py')
-rw-r--r--core/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/utils.py b/core/utils.py
index 3cb2d8a..f15d6cc 100644
--- a/core/utils.py
+++ b/core/utils.py
@@ -46,6 +46,7 @@ TROG = {"pagecache": {"expedition": {}}, "caves": {"gcavelookup": {}, "gcavecoun
alphabet = []
sha = hashlib.new('sha256')
COOKIE_MAX_AGE = 2*365*24*60*60 # seconds
+COOKIE_SHORT_TIMEOUT = 60*60 # seconds
throw = 35.0
EXPOSERVER = "expo" # hostname of the server at expo.survex.com
@@ -76,6 +77,11 @@ except:
# Opening of file for writing is going to fail currently, so decide it doesn't matter for now
pass
+def get_cookie_max_age():
+ """This is where we detect whether the machine the user is using is a shared-use device or a personbal device.
+ If it is shared-use, then we set a much shorter cookie timout period.
+ """
+ return COOKIE_MAX_AGE
def sanitize_name(name):
"""Filenames sould not contain these characters as then the system barf when it tries to use them in URLs