Fork me on GitHub
#graphql
<
2019-10-02
>
erwinrooijakkers10:10:23

How do I add cookies?

erwinrooijakkers10:10:21

I tried adding io.pedestal.http.ring-middlewares/cookies interceptor and then adding :cookies field to response:

{:status 200
       :cookies {"a" {:value ""}
                 "b" {:value ""}
                 "c" {:value ""}}
but it does not work

erwinrooijakkers10:10:03

And also:

(def set-some-cookies-interceptor
  (fn [request]
    {:status 200
     :headers {"Set-Cookie" "a=; b=;"}})))
only sets the a cookie, not b

erwinrooijakkers11:10:16

FYI this works:

{:headers {"Set-Cookie" ["a=; path=/;" "b=; path=/;"]}}
Thanks to @orestis

orestis11:10:32

Thanks to MDN 😄