diff --git a/app/routes.py b/app/routes.py index 1f58a7d..d236682 100644 --- a/app/routes.py +++ b/app/routes.py @@ -70,21 +70,21 @@ def session_required(f): # Clear out old sessions invalid_sessions = [] for user_session in os.listdir(app.config['SESSION_FILE_DIR']): - session_path = os.path.join( + file_path = os.path.join( app.config['SESSION_FILE_DIR'], user_session) - # Ignore any files that are larger than the max session file size - if os.path.getsize(session_path) > app.config['MAX_SESSION_SIZE']: - continue - try: - with open(session_path, 'rb') as session_file: + # Ignore files that are larger than the max session file size + if os.path.getsize(file_path) > app.config['MAX_SESSION_SIZE']: + continue + + with open(file_path, 'rb') as session_file: _ = pickle.load(session_file) data = pickle.load(session_file) if isinstance(data, dict) and 'valid' in data: continue - invalid_sessions.append(session_path) + invalid_sessions.append(file_path) except (EOFError, FileNotFoundError, pickle.UnpicklingError): pass diff --git a/app/templates/index.html b/app/templates/index.html index 10f6b6f..21821f9 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -93,7 +93,7 @@