这可以通过编辑session_gc方法来完成.../addons/web/http.py.以下代码说明了您的需求 - 删除或注释掉if条件(并相应地取消缩进以下行):
def session_gc(session_store):
#if random.random() < 0.001:
# we keep session one week
last_week = time.time() - x
for fname in os.listdir(session_store.path):
path = os.path.join(session_store.path, fname)
try:
if os.path.getmtime(path) < last_week:
os.unlink(path)
except OSError:
pass
Run Code Online (Sandbox Code Playgroud)
根据x您的需要,是超时的秒数.
| 归档时间: |
|
| 查看次数: |
853 次 |
| 最近记录: |