Skip to content

Commit

Permalink
Allow setting of :cookie-attrs for ring session cookies.
Browse files Browse the repository at this point in the history
  • Loading branch information
ignacio committed Aug 4, 2011
1 parent 6451415 commit 76862c4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/noir/session.clj
Expand Up @@ -52,7 +52,14 @@
(when-let [resp (handler request)]
(assoc resp :session @*noir-session*)))))

(defn assoc-if [m k v]
(if (not (nil? v))
(assoc m k v)
m))

(defn wrap-noir-session [handler]
(-> handler
(noir-session)
(wrap-session {:store (options/get :session-store (memory-store mem))})))
(wrap-session
(assoc-if {:store (options/get :session-store (memory-store mem))}
:cookie-attrs (options/get :session-cookie-attrs)))))

0 comments on commit 76862c4

Please sign in to comment.