Show me a website without any cookies, and I'll show you a pamphlet. At some point, you're going to need to write a cookie. Indeed, we've already seen that Ring writes out a cookie for us right out of the box for session tracking.
We can interact with cookies using the
noir.cookies namespace. At its most basic,
noir.cookies provides two functions:
We can get a cookie's value by calling
noir.cookies/get and providing either a string or a keyword for the name of the cookie to retrieve. We can see this in action by creating a trivial route that simply renders out the value of the ring-session cookie:
(require '[compojure.core :refer :all] '[noir.cookies :as cookies]) (defroutes some-route (GET "/ring-session" ...