Anybody got a complete example with Luminus on cookie handling? This is the last step to be able to publish my first Clojure app and I am missing something. Thanks.
Hey @mark549, I've added a couple of routes and handlers to demonstrate setting and retrieving a cookie: https://github.com/jtlocsei/hello-world-web-app/commit/d7afdb420d2765ca97d6befe831bf454ca581c5b
You probably already know this but you can inspect cookies in Chrome to see what's going on while you're debugging: https://developer.chrome.com/docs/devtools/storage/cookies/
Live demo: https://guessing-game.mircloud.us/math/choose-level A cookie is used to store chosen difficulty level, and the question you get on the next page depends on the difficulty level you chose.
Thanks!
Yes, ... background of what I'm doing:
I just want to have the user pick a level and represent that in the code ... I have the actions set up correctly, but getting the information in is my question:
(1) Better to use a cookie or an atom?
(2) If a cookie: what's the syntax in Luminus for:
(a) setting a cookie
(b) getting a cookie value back to use in the code
Thanks much for any suggestions!
I don't have an example but if you have a specific question then I might be able to help