             ; requiring so mount sees state
             [braid.server.email-digest :refer [email-jobs]]))
 
+(def session-max-age (* 60 60 24 365))
+
 ; NOT using config here, b/c it won't have started when this runs
 (if (= (env :environment) "prod")
   (do

  (-> defaults
      (assoc-in [:session :cookie-name] "braid")
      (assoc-in [:session :cookie-attrs :secure] false #_(= (env :environment) "prod"))
      (assoc-in [:session :cookie-attrs :max-age] (* 60 60 24 7))
      (assoc-in [:session :store] session-store)))

(defn assoc-csrf-conf [defaults]

                                        :port 6379}})
    (let [carmine-store (ns-resolve 'taoensso.carmine.ring 'carmine-store)]
      (def session-store
        (carmine-store '*redis-conf* {:expiration-secs session-max-age
                                      :key-prefix "braid"}))))
  (do
    (require 'ring.middleware.session.memory)
