I found code for an older version of CherryPy:
len(cherrypy.session.cache)
http://tools.cherrypy.org/wiki/ActiveSessionCount
but this no longer works in CherryPy 3.2.2.
Error => AttributeError: ‘FileSession’ object has no attribute ‘cache’
Thanks in advance!
Ok, since I’m storing session data in the file system I needed to go about getting the number of sessions a different way. Basically for each user a file is created in the session folder of my application based on my config settings…
So I just need count the number of files in the sessions folder. I accomplish this by the following line of code:
[this code excludes files with a *.lock extension or else a session could be counted twice]
Andrew