Question

I've defined an app and wish to be able to print out all the values contained in session store is there a good way to do this?

(def app
  (-> #'handler
      (ring.middleware.stacktrace/wrap-stacktrace)
      (ring.middleware.session/wrap-session)))
Was it helpful?

Solution

You can specify the session store for wrap-session to use:

(def all-the-sessions (atom {}))

(def app
  (-> #'handler
    (ring.middleware.stacktrace/wrap-stacktrace)
    (ring.middleware.session/wrap-session {:store (ring.middleware.session.memory/memory-store all-the-sessions)))

Now you can inspect the all-the-sessions atom.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top