Fork me on GitHub
#pedestal
<
2022-10-19
>
onetom06:10:37

I wonder why is deref necessary https://github.com/pedestal/pedestal/blob/95e0f1b9f81b2fe1a11b98ab37517296bcc289ca/service/src/io/pedestal/http/ring_middlewares.clj#L201:

(let [options ((deref #'session/session-options) options)]
where session/session-options is:
(defn- session-options
  [options]
  {:store        (options :store (mem/memory-store))
...
i would have thought that calling the #'session/session-options var directly does a deref anyway...

hlship16:10:17

Do you have pointers to the source?

onetom10:10:45

i provided the link already, but i guess it's hard to see, that the word "here" is a link, so here it is again: https://github.com/pedestal/pedestal/blob/95e0f1b9f81b2fe1a11b98ab37517296bcc289ca/service/src/io/pedestal/http/ring_middlewares.clj#L201

onetom06:10:31

what is https://github.com/pedestal/pedestal/blob/95e0f1b9f81b2fe1a11b98ab37517296bcc289ca/service/test/io/pedestal/http/ring_middlewares_test.clj#L214 testing:

; delete session
            (#(assoc % :response (assoc (:request %) :session nil)))
we shouldn't just have everything from the :request put into the :response, no? i was expecting just a direct clearing of the :session, eg:
; delete session
            (#(assoc-in % [:response :session] nil))

onetom06:10:43

(im just looking into these things, because i want to use the ring session middleware as a sieppari interceptor, in a reitit setup, which doesn't seem to provide an example of how to do that.)