         uri (or db-uri "datomic:mem://localhost:4334/osmium")]
     (component/system-map
      :db (db/map->Datomic {:uri uri})
-     :server (component/using (map->Server {:port http-port}) [:db]))))
+     :session-store (new-session-store)
+     :server (component/using (map->Server {:port http-port}) [:db :session-store]))))
 
 (defonce system (atom (new-system {})))
 

            [osmium.db :as db]
            [osmium.book :as book]
            [osmium.web :as web]
            [osmium.user :as user]))

;;  ======================================================================
;; Routes

(defn start-jetty [handler port]
  (jetty/run-jetty handler {:port (Integer. port) :join? false}))

(defrecord Server [session-store db port jetty]
  component/Lifecycle
  (start [component]
    (println "Start server at port:" port)
    (assoc component :jetty (start-jetty (app-handler session-store db) port)))
  (stop [component]
    (println "Stop server")
    (when jetty
