         resource-routes
         site-routes
         sync-routes)
-      (-> site-defaults ; TODO: switch to secure-site-defaults when in using https in prod
+      (-> (if (= (env :environment) "prod")
+            secure-site-defaults
+            site-defaults)
+          (assoc-in [:session :store] (carmine/carmine-store *redis-conf*
+                                                             {:expiration-secs (* 60 60 24 7)
+                                                              :key-prefix "lpchat"}))
           (assoc-in [:security :anti-forgery]
             {:read-token (fn [req] (-> req :params :csrf-token))})))
       wrap-edn-params))

(defroutes resource-routes
  (resources "/"))

(def app
  (->
    (wrap-defaults

            [compojure.route :refer [resources]]
            [compojure.handler :refer [api]]
            [compojure.core :refer [GET POST routes defroutes context]]
            [ring.middleware.defaults :refer [wrap-defaults secure-site-defaults site-defaults]]
            [ring.middleware.edn :refer [wrap-edn-params]]
            [taoensso.carmine.ring :as carmine]
            [chat.server.sync :refer [sync-routes]]
            [environ.core :refer [env]]
            [chat.server.db :as db]))

(defn edn-response [clj-body]
