You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First and foremost: The world needs something like Macchiato and I've used for several projects by now: thanks for making it work!
Now for my issue ;) …
Using the current template and following the current Documentation, cookies set “by hand” show up as `nil´ in subsequent request. Consider the following server config:
(defn home [req res raise]
(-> (str (:cookies req))
(r/ok)
(assoc-in [:cookies "mycookie" :value] "is_set")
(r/content-type "text/html")
(res)))
(defn server []
(mount/start)
(let [host (or (:host @env) "127.0.0.1")
port (or (some-> @env :port js/parseInt) 3001)]
(http/start
{:handler home
:host host
:port port
:on-success #(info "guestbook started on" host ":" port)})))
“mycookie” is sucessfully set in the browser, but subsequent requests show {"macchiato-session" {:value "G__1"}, "macchiato-session.sig" {:value nil}, "mycookie" {:value nil}}.
In order to assoc cookies as described in the documentation, it seems one has to use unsigned cookies and thus add :cookies {:signed? false} to the server configuration. I feel this should at least be part of the documentation and template.
Even better would be knowing how to actually make macchiato work with signed cookies… I assume it's possible given the option for it but haven't figured out how… any clues?
The text was updated successfully, but these errors were encountered:
Hi, glad to hear that Macchiato came in handy. And the issue definitely does looks like a bug. I completely agree that the session should work with signed cookies. This would probably be the place to look. I might not have a chance to investigate in the near future, but if you'd be up for poking around I could definitely help getting a PR in and doing a release.
First and foremost: The world needs something like Macchiato and I've used for several projects by now: thanks for making it work!
Now for my issue ;) …
Using the current template and following the current Documentation, cookies set “by hand” show up as `nil´ in subsequent request. Consider the following server config:
“mycookie” is sucessfully set in the browser, but subsequent requests show
{"macchiato-session" {:value "G__1"}, "macchiato-session.sig" {:value nil}, "mycookie" {:value nil}}
.In order to
assoc
cookies as described in the documentation, it seems one has to use unsigned cookies and thus add:cookies {:signed? false}
to the server configuration. I feel this should at least be part of the documentation and template.Even better would be knowing how to actually make macchiato work with signed cookies… I assume it's possible given the option for it but haven't figured out how… any clues?
The text was updated successfully, but these errors were encountered: