     (is (= {"Set-Cookie" (list "a=b")}
            (:headers resp)))))
 
+(defn- split-set-cookie [headers]
+  (letfn [(split-header [v] (set (mapcat #(str/split % #";") v)))]
+    (update-in headers ["Set-Cookie"] split-header)))
+
 (deftest wrap-cookies-set-extra-attrs
   (let [cookies {"a" {:value "b", :path "/", :secure true, :http-only true }}
         handler (constantly {:cookies cookies})
         resp    ((wrap-cookies handler) {})]
-    (is (= {"Set-Cookie" (list "a=b;Path=/;Secure;HttpOnly")}
-           (:headers resp)))))
+    (is (= {"Set-Cookie" #{"a=b" "Path=/" "Secure" "HttpOnly"}}
+           (split-set-cookie (:headers resp))))))
 
 (deftest wrap-cookies-always-assocs-map
   (let [req  {:headers {}}

                      :expires "123"}}
        handler (constantly {:cookies cookies})
        resp    ((wrap-cookies handler) {})]
    (is (= {"Set-Cookie" (list "a=b;Path=/;Secure;HttpOnly;Expires=123")}
           (:headers resp)))))

(deftest wrap-cookies-accepts-max-age-from-clj-time
  (let [cookies {"a" {:value "b", :path "/",

        handler (constantly {:cookies cookies})
        resp    ((wrap-cookies handler) {})
        expires "Thu, 31 Dec 2015 00:00:00 +0000"]
    (is (= {"Set-Cookie" #{"a=b" "Path=/" "Secure" "HttpOnly" (str "Expires=" expires)}}
           (split-set-cookie (:headers resp))))))

(deftest wrap-cookies-throws-exception-when-not-using-intervals-correctly
  (let [cookies {"a" {:value "b", :path "/",
