2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 10:26:17 +00:00

refactoring cookie age as a function not a constant

This commit is contained in:
2025-06-14 20:36:31 +03:00
parent d8cdf7bc5a
commit 40fb066e2b
11 changed files with 30 additions and 23 deletions

View File

@@ -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