def _get_session(self, session_id): """Return the Quixote Session with given id, or None.""" session_mgr = get_session_manager() try: session = session_mgr[session_id] except KeyError: session = None return session
def expire_sessions(): """Expire user sessions.""" expired_count = get_session_manager().del_sessions( age=SESSION_EXPIRE_HOURS) if expired_count: transaction_commit(None, 'ExpireSessions')