Fork me on GitHub
Mark McWiggins20:05:05

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.


I don't have an example but if you have a specific question then I might be able to help

Mark McWiggins22:05:19

Yes, ... background of what I'm doing:

Mark McWiggins22:05:15

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:

Mark McWiggins22:05:30

(1) Better to use a cookie or an atom?

Mark McWiggins22:05:47

(2) If a cookie: what's the syntax in Luminus for:

Mark McWiggins22:05:56

(a) setting a cookie

Mark McWiggins22:05:16

(b) getting a cookie value back to use in the code

Mark McWiggins22:05:26

Thanks much for any suggestions!


Hey @U01H6546F4Y, I've added a couple of routes and handlers to demonstrate setting and retrieving a cookie:


You probably already know this but you can inspect cookies in Chrome to see what's going on while you're debugging:


Live demo: 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.