 
         {:status 302
          :headers {"Location" (or (get params "requested-uri") "/")} ; "/" can be parameterized (TODO)
-         :cookies {"session" (start-session! session-store id)
+         :cookies {"session-id" (start-session! session-store id)
                    "requested-uri" ""}}
 
         ;; Return back to login form

                              (s/required-key :type) s/Str
                              (s/optional-key :label) s/Str
                              (s/optional-key :placeholder) s/Str
                              (s/optional-key :required) s/Bool}]
   })

(defn new-login-form [& {:as opts}]
  (component/using

  LoginFormRenderer
  (render-login-form [_ request {:keys [requested-uri action login-status fields]}]
    (html
     [:div
      [:form {:method "POST"
              :style "border: 1px dotted #555; padding: 10pt"
              :action action}

       [:h2 "Please sign in"]

       (when login-status
         [:div
          [:p
           (case login-status
             :failed [:span [:strong "Failed: "] "Please check login credentials and try again or " [:a.alert-link {:href "#"} "reset your password"] "."])]])

       (for [{:keys [id label name type value placeholder required autofocus]} fields]
         [:div
          [:label {:for id} label]
          [:input (merge
                   {:name name :type type :value value}
                   (when placeholder {:placeholder placeholder})
                   (when required {:required required})
                   (when autofocus {:autofocus autofocus}))]])

       (when (not-empty requested-uri)
         [:input {:type "hidden" :name :requested-uri :value requested-uri}])

       [:input {:type "submit" :value "Sign in"}]

       [:p
        [:a {:href "#"} "Reset password"]]
       ]])))

(defn new-plain-login-form-renderer []
