0.2.3 permalink Arrow_down_16x16
  • (memory-store)
Creates an in-memory session storage engine.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source ring/middleware/session/memory.clj:5 top

(defn memory-store
  "Creates an in-memory session storage engine."
  []
  (let [session-map (atom {})]
    {:read (fn [session-key]
             (@session-map session-key {}))
     :write (fn [session-key session]
              (let [session-key (or session-key (str (UUID/randomUUID)))]
                (swap! session-map assoc session-key session)
                session-key))
     :delete (fn [session-key]
               (swap! session-map dissoc session-key)
               nil)}))
Vars in ring.middleware.session.memory/memory-store: defn let
Used in 0 other vars

Comments top

No comments for memory-store. Log in to add a comment.