def __init__(self, server='localhost:6379', db=None, debug=False,
            session_expiry=False, with_lock=False, password=None):
        self.server = server
        self.password = password
        self.db = db or 0
        host, port = (self.server.split(':') + ['6379'])[:2]
        port = int(port)
        self.debug = debug
        if current and current.request:
            self.app = current.request.application
        else:
            self.app = ''
        self.r_server = redis.Redis(host=host, port=port, db=self.db, password=self.password)
        if with_lock:
            RedisClient._release_script = \
                    self.r_server.register_script(_LUA_RELEASE_LOCK)
        self.tablename = None
        self.session_expiry = session_expiry
        self.with_lock = with_lock
session_expiry can be an integer, in seconds, to set the default expiration
dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/contrib/redis_session.py/RedisClient.__init__