def __init__(self, key_template=config.SESSION_KEY, expire=config.SESSION_EXPIRE, \ salt=config.SESSION_SALT, pool=None): SessionStore.__init__(self) self.redis = Redis(connection_pool=pool) self.key_template = key_template self.expire = expire self.salt = salt
def __init__(self, session_class=None, servers=None, default_timeout=600, key_prefix=None): SessionStore.__init__(self, session_class) self.mc = MemcachedCache(servers, default_timeout, key_prefix)
def __init__(self, session_class=None): self.COOKIE_NAME = "sessionfast" SessionStore.__init__(self, session_class=None) self.sessions = {} # Number of minutes before sessions expire self.expire = 40
def __init__(self, servers, session_class=Session): SessionStore.__init__(self, session_class) try: import cmemcache as memcache except ImportError: import memcache self.client = memcache.Client(servers)
def __init__(self, file_path=None, session_class=Session): import bsddb SessionStore.__init__(self, session_class) if file_path is None: from tempfile import gettempdir file_path = os.path.join(gettempdir(), 'session.bdb') self.db = bsddb.hashopen(file_path)
def __init__(self, session_class=None, key_prefix=''): SessionStore.__init__(self, session_class=session_class) self.redis = redis.Redis(tools.config.get('redis_host', 'localhost'), int(tools.config.get('redis_port', 6379)), int(tools.config.get('redis_dbindex', 1)), password=tools.config.get('redis_pass', None)) self.path = openerp.tools.config.session_dir self.expire = int(tools.config.get('redis_session_expire', 1800)) self.key_prefix = key_prefix
def __init__(self, redis, key_template='session:%s', generate_salt=None): if not generate_salt: from users import get_config generate_salt = get_config().users_secret SessionStore.__init__(self) self.redis = redis self.key_template = key_template self.generate_salt = generate_salt
def __init__(self, session_class=None, collection=None): SessionStore.__init__(self, session_class) if not collection: raise ValueError('collection can not be None') self.collection = db[collection] # Empty session collection self.collection.remove()
def __init__(self, session_class=None, host=None, port=None, replicaset=None, db=None, collection=None): SessionStore.__init__(self, session_class) self.host = host self.port = port self.replicaset = replicaset self.db_name = db self.collection_name = collection self.db = None self.collection = None self.client = None self.mongo_init()
def __init__(self, path=None, filename_template='werkzeug_%s.sess', session_class=None, renew_missing=False, mode=0644): SessionStore.__init__(self, session_class) if path is None: path = tempfile.gettempdir() self.path = path if isinstance(filename_template, unicode): filename_template = filename_template.encode( sys.getfilesystemencoding() or 'utf-8') assert not filename_template.endswith(_fs_transaction_suffix), \ 'filename templates may not end with %s' % _fs_transaction_suffix self.filename_template = filename_template self.renew_missing = renew_missing self.mode = mode
def __init__(self, app, session_cache_config=None, app_cache_config=None): SessionStore.__init__(self) # check if app cache config exists, otherwise use the same as cache_config if app_cache_config and not session_cache_config: self._app_cache_client = Cache(config=app_cache_config) self._session_cache_client = Cache(config=app_cache_config) elif app_cache_config and session_cache_config: self._app_cache_client = Cache(config=app_cache_config) self._session_cache_client = Cache(config=session_cache_config) elif not app_cache_config and session_cache_config: self._app_cache_client = Cache(config=session_cache_config) self._session_cache_client = Cache(config=session_cache_config) else: self._app_cache_client = self._session_cache_client = Cache() self._app_cache_client.init_app(app) #self._session_cache_client.init_app(app) # now set the app config to contain the cache app.config['_session_cache'] = self._session_cache_client app.config['_app_cache'] = self._app_cache_client
def __init__(self, servers=None, key_prefix=None, default_timeout=300): SessionStore.__init__(self) if isinstance(servers, (list, tuple)): try: import cmemcache as memcache is_cmemcache = True except ImportError: try: import memcache is_cmemcache = False is_pylibmc = False except ImprotError: try: import pylibmc as memcache is_cmemcache = False is_pylibmc = True except ImportError: raise RuntimeErorr(' no memcache module found ') if is_cmemcache: client = memcache.Client(map(str, servers)) try: client.debuglog = lambda *a: None except Exception: pass else: if is_pylibmc: client = memcache.Client(servers, False) else: client = memcache.Client(servers, False, HIGHEST_PROTOCOL) else: client = servers self._memcache_client = client self._memcache_key_prefix = key_prefix self._memcache_timeout = default_timeout
def __init__(self, session_class=None): if session_class is None: session_class = Session SessionStore.__init__(self, session_class) self.session_class = session_class
def __init__(self, session_class=None): SessionStore.__init__(self, session_class=None) self.sessions = {}
def __init__(self, session_class=Session): SessionStore.__init__(self, session_class)
def __init__(self, key_prefix=None, host='127.0.0.1', dbindex=1, expire=1800): SessionStore.__init__(self) self.redis = redis.StrictRedis.from_url(host) self.key_prefix = key_prefix self.expire = expire
def __init__(self, key_prefix=None, host='127.0.0.1', port=6379, dbindex=1, expire=1800): SessionStore.__init__(self) self.redis = redis.Redis(host,port,dbindex) self.key_prefix = key_prefix self.expire = expire
def __init__(self, servers, session_class=Session): SessionStore.__init__(self, session_class) import memcache self.client = memcache.Client(servers)
def __init__(self, session_class=Session): SessionStore.__init__(self, session_class) from google.appengine.api import memcache self.client = memcache
def __init__(self): SessionStore.__init__(self, None)