noir-clojure / lib-noir

A set of libraries for ring apps, including stateful sessions.
Eclipse Public License 1.0
479 stars 47 forks source link

Cookie attribute type #103

Closed adamneilson closed 10 years ago

adamneilson commented 10 years ago

Quite a trivial thing but the docs state that you can add the following:


(cookies/put! :track
              {:value (str (java.util.UUID/randomUUID))
              :path "/"
              :expires 1})

But what I've found is that the :expires attribute must be a string rather than an int otherwise it throws an exception:

 java.lang.AssertionError: Assert failed: (every? valid-attr? attrs)

I'm not sure if the docs need updating to reflect that or whether it's a bug in the lib where it should take the int without complaining.

Thanks!

yogthos commented 10 years ago

It appears that Ring requires the expires key to either be a DateTime or a string. I think the documentation should be updated as I don't believe it would be a good idea to coerce the value automatically.