如何在aiohttp中实现redis session过期
How to implement redis sessions expire in aiohttp
我在 aiohttp redis 会话中找不到 redis 会话过期实现。会话保存在 redis 中,但后来我检查了 ttl AIOHTTP_SESSION_c8a63762a87d4c01a64991e268c35f54 会话密钥没有 ttl。
如何实现过期以避免旧会话增长?我正在考虑设置
expire 'AIOHTTP_SESSION_'+session.identity 300
对于会话中间件中的每个请求,这是方便的方式还是我遗漏了什么?
您可以在 aiohttp-session 文档中看到 RedisStorage
take a max_age
parameter. This is used to set the expiration time of the associated redis key in redis_storage.py
我在 aiohttp redis 会话中找不到 redis 会话过期实现。会话保存在 redis 中,但后来我检查了 ttl AIOHTTP_SESSION_c8a63762a87d4c01a64991e268c35f54 会话密钥没有 ttl。
如何实现过期以避免旧会话增长?我正在考虑设置
expire 'AIOHTTP_SESSION_'+session.identity 300
对于会话中间件中的每个请求,这是方便的方式还是我遗漏了什么?
您可以在 aiohttp-session 文档中看到 RedisStorage
take a max_age
parameter. This is used to set the expiration time of the associated redis key in redis_storage.py