This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-09
Channels
- # announcements (14)
- # babashka (2)
- # beginners (33)
- # calva (25)
- # cider (4)
- # clj-kondo (14)
- # clojure (11)
- # cursive (4)
- # datomic (3)
- # fulcro (53)
- # gratitude (3)
- # integrant (2)
- # leiningen (7)
- # lsp (10)
- # malli (34)
- # missionary (3)
- # off-topic (71)
- # other-languages (18)
- # pathom (1)
- # practicalli (2)
- # releases (1)
- # ring (4)
- # spacemacs (1)
- # vim (14)
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 ?
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.
Can you open an issue for this? It looks like an interaction that wasn’t considered.
Sorry for the delay, but the issue has been filed 🙂 https://github.com/ring-clojure/ring/issues/456 including a repro