Thank you very much Richard!
With your help I was able to retrieve the keys of the sessions stored in
Redis with this simple line of code:
session_keys = cache.redis.r_server.smembers('w2p:sess:%s:id_idx' %
application_name)
That line returns a set with all the session keys stored in Redis.
I gave a look directly in the redis shell
redis-cli -h localhost -p 6379 -a PASSWORD_IF_YOU_SET_ONE
It appears that each session store will have a different key which goes
like that : w2p:sess:APP_NAME:SOME_ID
And w2p:sess:APP_NAME:id_idx will contains a set of each unique session
existings, so
Recently I moved the sessions from the database to Redis, and I'm
wondering: is there a way to retrieve info about sessions when they are
stored in Redis?
For example, when sessions are stored in the database, you have the option
to use SQL to do some stuff like counting or deleting sessions.
3 matches
Mail list logo