# HG changeset patch # User Chong Yidong # Date 1175441953 0 # Node ID 5a7d99e3ab6d1118221facb28c33702dc80b4711 # Parent 8fca90acf555934f2aa8d5a0ef2bcf756cc27913 (url-http-handle-cookies): Reverse list returned by `mail-fetch-field', so that cookies are set in the correct order. diff -r 8fca90acf555 -r 5a7d99e3ab6d lisp/url/url-http.el --- a/lisp/url/url-http.el Sun Apr 01 15:38:50 2007 +0000 +++ b/lisp/url/url-http.el Sun Apr 01 15:39:13 2007 +0000 @@ -381,8 +381,8 @@ "Handle all set-cookie / set-cookie2 headers in an HTTP response. The buffer must already be narrowed to the headers, so `mail-fetch-field' will work correctly." - (let ((cookies (mail-fetch-field "Set-Cookie" nil nil t)) - (cookies2 (mail-fetch-field "Set-Cookie2" nil nil t))) + (let ((cookies (nreverse (mail-fetch-field "Set-Cookie" nil nil t))) + (cookies2 (nreverse (mail-fetch-field "Set-Cookie2" nil nil t)))) (and cookies (url-http-debug "Found %d Set-Cookie headers" (length cookies))) (and cookies2 (url-http-debug "Found %d Set-Cookie2 headers" (length cookies2))) (while cookies