This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-14
Channels
- # ai (3)
- # babashka (45)
- # beginners (81)
- # biff (26)
- # calva (10)
- # cider (5)
- # clj-kondo (55)
- # cljfx (6)
- # clojure (125)
- # clojure-berlin (1)
- # clojure-europe (37)
- # clojure-italy (7)
- # clojure-nl (3)
- # clojure-norway (79)
- # clojure-uk (1)
- # clojurescript (63)
- # clojutre (1)
- # conjure (5)
- # cursive (37)
- # data-science (1)
- # datalevin (4)
- # datomic (28)
- # eastwood (6)
- # fulcro (26)
- # graphql (20)
- # honeysql (6)
- # humbleui (4)
- # jobs-discuss (5)
- # kaocha (1)
- # leiningen (8)
- # missionary (5)
- # nbb (4)
- # observability (3)
- # off-topic (7)
- # pathom (8)
- # podcasts-discuss (1)
- # rewrite-clj (18)
- # ring (6)
- # sci (23)
- # scittle (9)
- # shadow-cljs (49)
- # squint (10)
- # testing (11)
- # xtdb (17)
Hi, I have a problem setting a cookie with "expires" attribute
(assoc (response/ok)
:cookies {"hehe" {:expires "2022-10-14T03:26:52.000Z"
:value "eheheeheh"}})
Using this code, the cookie gets set, but the "expires" attribute is just ignored. Why does this happen? How can I debug it? I use default ring middlewarehttps://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie has a section on expires with a link to a place that talks about how those dates are formatted
If joda time is available, ring also supports passing a joda datetime instead of a string, and you can see how it formats those https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/cookies.clj#L84
Oh, it supports a java.time zoneddatetime, so just use one of those https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/cookies.clj#L101
yeah, ZonedDateTime worked. Thank you, I've spent a few hours trying different things, going through source code before asking (╯ ͡° ͜ʖ ͡°)╯︵ ┻━┻