From 2d082c186f5b46e194f08eb6ef351aa2270efb81 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 26 Mar 2004 23:54:40 +0000 Subject: [PATCH] handle older sessions git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2218 57a73879-2fb5-44c3-a270-3262357dd7e2 --- CHANGES.txt | 1 + roundup/backends/sessions_dbm.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 3287abb..2d20e4c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -21,6 +21,7 @@ Fixed: - edit collision detection was broken for index-page edits - sqlite backend wasn't migrating multilink tables correctly - use SimpleCookie instead of Cookie (is an alias for the evil SmartCookie) +- handle older sessions in session dbm 2004-03-24 0.7.0b1 diff --git a/roundup/backends/sessions_dbm.py b/roundup/backends/sessions_dbm.py index 433db42..82782d0 100644 --- a/roundup/backends/sessions_dbm.py +++ b/roundup/backends/sessions_dbm.py @@ -1,4 +1,4 @@ -#$Id: sessions_dbm.py,v 1.2 2004-03-19 04:47:59 richard Exp $ +#$Id: sessions_dbm.py,v 1.3 2004-03-26 23:54:40 richard Exp $ """This module defines a very basic store that's used by the CGI interface to store session and one-time-key information. @@ -131,7 +131,8 @@ class BasicDatabase: """ week = 60*60*24*7 for sessid in self.list(): - interval = now - self.get(sessid, '__timestamp') + interval = now - self.get(sessid, '__timestamp', + default=time.time()) if interval > week: self.destroy(sessid) -- 2.30.2