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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user