def __len__(self):
        """Return the number of active sessions."""
        return len(
            [
                fname
                for fname in os.listdir(self.storage_path)
                if (
                    fname.startswith(self.SESSION_PREFIX)
                    and not fname.endswith(self.LOCK_SUFFIX)
                )
            ],
        )
Return the number of active sessions.
cherrypy/lib/sessions.py