Exemplo n.º 1
0
 def __init__(self, sessionTimeout=1800):
     SessionStrategy.__init__(self)
     self.logger = logging.getLogger("seminode.web.sessionstrategy.SeminodeSessionStrategy")
     self.logger.debug("SeminodeSessionStrategy initialized")
     self.sessionManager = FileSessionManager('var/sessions')
     sessionTimeout = int(sessionTimeout)
     self.sessionManager.purge(sessionTimeout)
Exemplo n.º 2
0
class SeminodeSessionStrategy(SessionStrategy):
    
    def __init__(self, sessionTimeout=1800):
        SessionStrategy.__init__(self)
        self.logger = logging.getLogger("seminode.web.sessionstrategy.SeminodeSessionStrategy")
        self.logger.debug("SeminodeSessionStrategy initialized")
        self.sessionManager = FileSessionManager('var/sessions')
        sessionTimeout = int(sessionTimeout)
        self.sessionManager.purge(sessionTimeout)
    
    def getHttpSession(self, environ):
        #if self.store.session == None:
        session = self.sessionManager.read_session(environ)
        environ['pesto.session'] = session
        return session

    def setHttpSession(self, session):
        session.save()