From 10fbeaed7bbdebca2cb389d60710dda7c3602590 Mon Sep 17 00:00:00 2001 From: stamparm Date: Mon, 15 Apr 2013 11:49:11 +0200 Subject: [PATCH] Code refactoring --- lib/core/common.py | 3 ++- lib/core/settings.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/core/common.py b/lib/core/common.py index 5f3be9c70..8c2dc77c8 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -92,6 +92,7 @@ from lib.core.settings import DUMMY_SQL_INJECTION_CHARS from lib.core.settings import DUMMY_USER_INJECTION from lib.core.settings import DYNAMICITY_MARK_LENGTH from lib.core.settings import ERROR_PARSING_REGEXES +from lib.core.settings import FORCE_COOKIE_EXPIRATION_TIME from lib.core.settings import FORM_SEARCH_REGEX from lib.core.settings import GENERIC_DOC_ROOT_DIRECTORY_NAMES from lib.core.settings import HASHDB_MILESTONE_VALUE @@ -3510,7 +3511,7 @@ def resetCookieJar(cookieJar): for line in lines: _ = line.split() if len(_) == 7: - _[4] = "9999999999" # The UNIX time that the variable will expire on + _[4] = FORCE_COOKIE_EXPIRATION_TIME f.write("\n%s" % "\t".join(_)) cookieJar.filename = filename diff --git a/lib/core/settings.py b/lib/core/settings.py index 292e8545e..213dc9df6 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -433,6 +433,9 @@ DEFAULT_GET_POST_DELIMITER = '&' # Default delimiter in cookie values DEFAULT_COOKIE_DELIMITER = ';' +# Unix timestamp used for forcing cookie expiration when provided with --load-cookies +FORCE_COOKIE_EXPIRATION_TIME = "9999999999" + # Skip unforced HashDB flush requests below the threshold number of cached items HASHDB_FLUSH_THRESHOLD = 32