ring

2022-01-09T21:43:41.004600Z

Hey! I'm looking into sessions with ring, and can't get the cookie and session middleware to play nice together. Especially when using a custom cookie encoder/decoder. The session middleware will set the :cookies-key preventing the cookie middleware from decoding the cookies. If I switch the session / cookies middleware around the cookies are decoded properly, but the session cookie won't be read using the correct encoder/decoder. I believe this is because the session-middleware calls the cookies/cookies-request and cookies/cookies-response functions instead of relying on the stack to do these calls. Should I change my approach? If so; how should I do it ?

weavejester 2022-01-12T16:47:26.005400Z

Can you open an issue for this? It looks like an interaction that wasn’t considered.

👍🏻 1
2022-01-18T09:35:40.007800Z

Sorry for the delay, but the issue has been filed 🙂 https://github.com/ring-clojure/ring/issues/456 including a repro

2022-01-09T21:57:01.004900Z

Removing the direct calls to the cookies-middleware in the sessions-middleware results in the intented behaviour; Which is both the session and the 'other' cookies being encoded and decoded using the setup encoder and decoder.