from Globals import Persistent from OFS.SimpleItem import SimpleItem import time class Session(Persistent, SimpleItem): meta_type = 'Session' def __init__(self, id, space_id): self.id = id self._session_key = id self._space_id = space_id self._last_used = time.time() def _getSpaceId(self): return self._space_id def _getSessionKey(self): return self._session_key def _getLastUsed(self): return self._last_used def _setLastUsed(self): """ updated last used time """ self._last_used = time.time() def isValid(self): #print self._getLastUsed(), time.time() - 3525, self._getLastUsed() > time.time() - 3525 return self._getLastUsed() > time.time() - 3525