There is a node.js-project, for work with sessions express-session is used. How can I bring all active sessions to the console without using any additional session-storage?

    1 answer 1

    Session information is stored on the server side only if you use special middleware that stores this data in the database. In this case, you can extract this data from this database. But even in this case, it will be difficult for you to determine whether the session is active. Therefore, if you need to keep records of active sessions, you will have to write your own code for this. Express out of the box does not know anything about the sessions. Middleware for sessions does not know anything about how this data is stored (cookies, DB or other).

    • If you do not take account of active, how to get all live sessions (for example, they have a shelf life of 5 minutes)? - sanu0074